On 27 June 2012 13:51, James Harris <lists@ruby-forum.com> wrote:
> Noob alert!
>
> Hi, I am having trouble figuring out how to filter a select helper. The
> following shows all of the rows in the table but I would like to filter
> the collection from the list_name column (:list_name => "Project
> Status"):
>
> @project_status = Valuelist.all.collect {|s| [s.list_value,s.id]}
Use Valuelist.where( .. ).collect {...
I think it would be worth while working through some tutorials such as
railstutorial.org, which is free to use online, to get the basics of
rails.
Colin
--
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.
No comments:
Post a Comment