Is "action" as a input field name forbidden? Because everything works except the assignment of the "action" param.
The params in a controller looks like a Hash, but it's actually an instance of ActionController::Parameters , which provides several methods such as require and permit . The require method ensures that a specific parameter is present, and if it's not provided, the require method throws an error.
In HTTP/HTML, the params are really just a series of key-value pairs where the key and the value are strings, but Ruby on Rails has a special syntax for making the params be a hash with hashes inside. For example, if the user's browser requested.
The PARAM element is used to provide "command-line" arguments to a Java applet, which is embedded in a document with the APPLET element. It has two attributes: NAME specifies the name of the argument, and VALUE specifies the value for this argument.
because action
, controller
are prohibited words.
Look around debug params
--- !map:ActiveSupport::HashWithIndifferentAccess
action: index
controller: main
so you can't use those params. Because they will be REWRITED AUTOMATICALLY
I would suggest NOT using words like action, name, method as field names as they are all attributes of the form tag and are likely to get confused when the form is posted
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