[Rails] Re: Re: Re: Search of multiple columns
Hey I installed the ransack gem and have added some basic code to my
code but have received an error now on my page which is the followin
undefined method `result' for #<Array:0x44cd540>
I have the following code in my gamescontroller.rb
def index
@q = Game.search(params[:q])
@game = @q.result(:distinct => true)
end
and the following code in my games/index.html.erb
<%= search_form_for @q do |f| %>
<%= f.label :game_name_start %>
<%= f.text_field :game_name_start %>
<%= f.submit %>
<% end %>
any ideas of what the problem might be?
--
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 post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home