in _form.html.erb there is submit button <%= f.submit %>
the button is labeled "Update Tablename". Can someone tell me, how to change it and what exatly happens, when i press submit?
BR Rogi
in _form.html.erb there is submit button <%= f.submit %>
the button is labeled "Update Tablename". Can someone tell me, how to change it and what exatly happens, when i press submit?
BR Rogi
in _form.html.erb there is submit button <%= f.submit %>
the button is labeled "Update Tablename". Can someone tell me, how to change it
If you pass a string to f.submit that will override the default label
and what exatly happens, when i press submit?
The form gets submitted. What happens next depends on what your controller does.
Fred
use
f.submit ‘Your custom label’
to override. After pressing the button, you will be passed to the action of the form of the button you pressed.
It will update the record with the data from" _form.html.erb" when u press it.
Look at the html of the form, it says for example
action= “user/create” method=“post”
it means the form will be send to the server with a post to the path user/create
rails router it RESTful (read about REST), if you type rake route in the console you will
see that if rails get send that request it will send the data in the page to the create action
and take the values in the form and create a hash, you then have to process the information
in the controller.
Not necessarily. It will initiate the action specified or implied by the form_for statement. Whether that updates a record or not depends on what is coded in that action.
Colin