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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 18, 12:24 pm, rogi <patrik.kel...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> in _form.html.erb there is submit button > <%= f.submit %> > > the button is labeled "Update Tablename". > Can someone tell me, how to change itIf 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> > BR > Rogi-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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. On Fri, Feb 18, 2011 at 8:24 PM, rogi <patrik.keller-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> 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 > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- ------------------------------------------------------------- visit my blog at http://jimlabs.heroku.com -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
It will update the record with the data from" _form.html.erb" when u press it. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
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<http://en.wikipedia.org/wiki/Representational_State_Transfer>), 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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 18 February 2011 12:32, seeni khan <rafiglitz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It will update the record with the data from" _form.html.erb" when u press > it.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 -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.