I want to be able to change one attribute of a link_to to be what is the
current selection of the collection_select. And needless to say I can’t
quite figure it out.
currently im a bit tired so im not able to write this code for you.
however, here is what i would do:
app/views/tasks/show.html.erb should be to view the task given by the
id
(tasks/1). so you shouldn’t do any edit on that article on the show page
itself.
this leads to
you should use a form for that. make a function task_assign in the
task
and pass the user you want to assign the task to in the params hash.
like
<%= form_for(@task) do |f| %>
<%= f.collection_select(“assign”, “user_id”, @users, :id, :full_name )%>
//
this line is copypasta from you, didnt look if right
<%= f.submit %>
<% end %>
you could, i say could, do the form on the show page as well, maybe need
to
specify controller and action then but that wont be a problem i guess.
greetings,
Crispin
Am Donnerstag, 13. September 2012 16:32:34 UTC+2 schrieb Brian E.:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.