Form submit with custom controller function

ruby-on-rails, ruby-on-rails-3, ruby-on-rails-3.1

Solution

<%= form_for @event, :url => { :action => "custom_update" } do |f| %>

You may want also to specify the method

<%= form_for @event, :url => { :action => "custom_update" }, :html => { :method => "put" } do |f| %>

Problem

I'm starting to develop a small application in Ruby On Rails. I have a short form in a view: ``` <%= form_for @event do |f| %> <%= f.fields_for :items do |item| %> <input type="number" id="quantity" /> <% end %> <%= f.submit 'Join', :name => "join" %> ``` I want to after click 'submit', run a controller's method that access to the data included in each of the fields in the form and perform insertions on the database. Actually the controller's method called is "update" but I want to call other controller's method cause update is only for the event creator so other users can't submit the form. How do I customize the action of the submit button to run controller's function (not update)?

Original source