On May 16, 2014, at 9:42 AM, Fab Forestier wrote:

>> Please quote the previous message in your reply so that it easier to
>> follow the thread.  Note that this is a mailing list not a forum
>> (though you may be accessing via a forum-like interface).
>> 
> Sorry I will pay attention new time!
> 
>> If the search actions do not fit well with one of the existing
>> controller then just create one specifically for searches.  However,
>> if the search is specifically for Articles then generally you would
>> put search actions in the articles controller.
>> 
>> Colin
> 
> My search bar will appear on all my views so I think it will be better 
> if I create a new controller but how I must call it if my view is in 
> views/pages/currentop? And how my view will be associated to this 
> controller?

That is down to how you structure your form tag in that view. This can be as 
simple as a hand-coded form (no need for form_for helper here) and whatever you 
called your controller (or however you defined your search route) will 
determine what the actual path is. Something like this:

        <form action="/search/results" method="get">
                <input type="search" name="q">
        </form>

Now if you have a search_controller.rb with a results method, and you made a 
route to hook that up, you should be in business.

Walter

> 
> Fab
> 
> -- 
> Posted via http://www.ruby-forum.com/.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/adfdcf2998b47e6c7a09c3eea86f2860%40ruby-forum.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/F6009271-9785-4AB1-A125-E8B100C48425%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to