kojilab wrote:
> Hi,
>
> Controller:
> @user_jobs = UserJob.find_by_user_id(current_user.id)
>
> View:
-----
> <%= collection_select :user_project :user_job_id,
> @user_jobs, :id, :title %>
> ----
>
> Thanks for your help
I usually do this:
Controller:
@user_jobs_list=[]
@user_jobs=UserJob.find_by_user_id(current_user.id)
for users in @user_jobs
@user_jobs_list << [users.name, users.id]
end
and then..
<%=collection select :user_project :user_job_id, @user_jobs_list, :id,
:title%>
Now the collection_select gets what it wants.
Jay
--
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---