Wasim Akram wrote:> hi all,
> can anybody say me
> how to pass a checkbox list values to controller using
> "submit_remote_to"and how to use the same thing in controller
let us say you are displaying list of records with a check box in your
view and you want to delete those marked records in your action...
view:
------
<% @collection.each do |c| %>
....other fields.....
<%= check_box_tag ''myrow[id][]'', c.id, false %>
<% end %>
controller:
-----------
def youraction
@a = Model.find(params[:myrow][:id])
@a.each { |t| t.destroy }
end
--
Posted via http://www.ruby-forum.com/.