When I create a form using simple_form_for @model, after submitting post, params has all the attributes grouped by [model] parameters. How do I get simple_form to remove this group and send it directly instead (at the root of params)?
<%= simple_form_for @user, do |f| %> <%= f.input :name %> <%= f.input :password %> <%= f.submit %>
Now the name and password attributes are usually sent under the parameters [: user] [: name], params [: user] [: password], etc. How to get simple_form to publish them as params [: name], params [: password] etc.?
Thanks!
Ramkumar
ps: If you are wondering why I need this, the main part of my application will serve as an API, and I created a set of methods for checking the request, which expects some attributes to be at the root. In the rare case (forgot password) I really need to submit a form, and I'm looking for a way to use these methods.
source share