Hello..
I have a form:
<%= form_for @instruction_user, :url => some_path do |f|%>
<% @users.each do |user| %>
<%= user.name %>
<%= f.input :prio, collection: 1..5, :as => :radio_buttons%>
<%= f.text_field :remark%>
<%= check_box_tag "instruction_user_ids[]", "#{user.id}" %>
controller:
if params[:instruction_user_ids]
params[:instruction_user_ids].each do|user_id|
InstructionUser.create(
:user_id => user_id, :instruction_id =>
params[:instruction_id], :remark => ????, :prio => ???
)
end
1. The table rows are generated, but the attributes :prio_tl and :remark_tl
are not in. How to write the [] .. take the form_fields?
2. Both attibutes need some indentifier!? I can not mark the radio-buttons
per row seperately..as they have the same id..
Would be great to get some idea about the best way to handle the form and
controller.
Thanks a lot
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/ieqWfqlz2MoJ.
For more options, visit https://groups.google.com/groups/opt_out.