Reputation: 6377
I am trying to pass a value from a view to the controller. The user is submitting a form, and I want to pass a hidden value which is not related to the form itself. So my question is: how can I manually add entries to the params hash?
Upvotes: 6
Views: 13687
Reputation: 56779
Use params.merge
.
See docs: http://ruby-doc.org/core/classes/Hash.html#M000759
A similar question: Rails - Is there a shortcut to pass all existing params?
Upvotes: 5