On Jan 30, 2013, at 6:33 AM, Ryo Saeba wrote:
> So this is what the method in the controller looks now
>
> def index
> if(params[:q])
> render :partial => 'search_results', :locals => @games
> else
> render :partial => 'no_search_yet'
> end
> end
>
> and I removed the one "@" in the index view, but it only results in,
> whenever I use the search, the "_no_search_yet" partial is being
> displayed. So the index page always displays this partial, no matter I
> use the search button or not.
What do you see in the console while you test? Did you name your search field q? params[:q] won't be filled unless that's the case. I can't recall whether you did or not.
Walter
>
> I think the problem is, the default link "http://localhost:3000/games"
> always leads to my index.view (altough not defined in the routes.rb).
> Having used the search function end in another Url, but the default
> always keeps the full list :/
>
> --
> 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 rubyonrails-talk+unsubscribe@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
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 rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No comments:
Post a Comment