I am starting to develop a small application in Ruby On Rails. I have a short form in the 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 that after clicking send, start the controller method, which refers to the data included in each of the fields on the form and performs inserts in the database.
Actually, the controller method is called βupdateβ, but I want to call another method method because the update is only for the event creator, so other users cannot submit the form.
How to configure the action of the submit button to start the controller function (not update)?
source
share