On Jan 30, 2013, at 1:01 PM, Ryo Saeba wrote:

> This is really weird. Having used ":q" as a name actually opens the "no 
> search yet" partial, wether I used the search function or not.
> 
> but using ":search" in my if clause I get a "NameError" in my index 
> file.
> 
> undefined local variable or method `games' for 
> #<#<Class:0x674f2c8>:0x3f8e698>

I made an error in my render partial code, it should read

render :partial => 'games', :locals => {:games => @games}

The missing symbol is what's throwing this off. The fact that you see something 
in the view when you use the wrong search symbol only tells you that the if 
statement works.

Walter

> 
> Extracted source (around line #3):
> 
> 1: <table>
> 2:
> 3: <% games.each do |game| %>
> 4:   <tr>
> 5:     <td><%= link_to game.title_german, game %></td>
> 6:     <td><%= game.title_original %></td>
> 
> returning the "@" to "games" would cause a nomethod error for "each"...
> 
> Sorry to be bothering with this, but I'm really confused...
> 
> -- 
> 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+unsubscr...@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+unsubscr...@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.


Reply via email to