Hi Anders You're going to want to have that search call in your controller, in an action/url that the link_to call points to.
This is a bit beyond the scope of most support requests here - I'd recommend spending a bit of time reading the Rails guides and understanding the MVC layers a bit better. http://guides.rubyonrails.org/ Good luck! -- Pat On 06/10/2010, at 8:03 AM, Anders_P wrote: > Hello! > > I'n trying to create a menu that gets rows from the database. If I for > example have a option called 'Jeans' then i want all my jeans to show > up in the view when the user clicks on that link. > > I have tried this: > > <li class="header"><%= link_to "Jeans", Ad.search('jeans') %></ > li><br /> > > But it doesn't work (and is probably completely wrong!?). I get the > following error: > > undefined method `model_name' for NilClass:Class > > Any tips or help would be appreciated! > > Thanks > // Anders > > > > > -- > You received this message because you are subscribed to the Google Groups > "Thinking Sphinx" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/thinking-sphinx?hl=en. > -- You received this message because you are subscribed to the Google Groups "Thinking Sphinx" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/thinking-sphinx?hl=en.
