Hello, I have a simple form that looks like so
<% remote_form_for post, :url => post_path(post), :method => :put do |f| -%>
<%= f.submit "Approve" %>
<%= f.submit "Deny" %>
<% end -%>
Which renders
<input type="submit" value="Approve" name="commit"/>
<input type="submit" value="Deny" name="commit"/>
In my controller I have the following logic
@post.approved = params[:commit] == 'Approve' ? true : false
So problem is that if the user clicks the "Approve" button or the "Deny" button the parameter that is sent is that :commit => "Approve"
.
Does anybody know of a bug relating to this or another (simple) way to perform the same functionality?
Thanks.