I'm trying to send an extra parameter submiting a form in rails using simple_form I thought this would do the trick:
<%= simple_form_for(@user, :groupId => 1) do |f| %>
but in tne controller, the parameter is ignored
I found an answer in here but I really like to have a better solution.
How about:
<%= simple_form_for @user, url: user_path(@user, :groupId => 1) do |f| %>
simple_form_for has a similar usage to form_for. See http://apidock.com/rails/ActionView/Helpers/FormHelper/form_for
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With