It''s such a simple question ... and I can''t find an answer. When I put up a form and I have a submit button ... cleary when the user clicks on it a uri is generated. What is that uri? In other words ... what method in which controller is generally called when the user hits to submit button? -- Posted via http://www.ruby-forum.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.
Ralph Shnelvar wrote:> It''s such a simple question ... and I can''t find an answer. >Because it''s a basic HTML question, not a Rails one.> When I put up a form and I have a submit button ... cleary when the user > clicks on it a uri is generated. What is that uri?Whatever the <form> tag''s action is.> > > In other words ... what method in which controller is generally called > when the user hits to submit button?Whatever method your routes map that URL to. -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote:> Whatever the <form> tag''s action is.Also, if no action is specified via the form tag, the form is submitted to the current url. So if ''thing/edit/1'' contained: <form> <input type="submit" /> </form> The form would be submitted back to ''thing/edit/1'' -- Posted via http://www.ruby-forum.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.
Rob and Marnen: Thank you! I am now curious why the designers of HTML put the "place to go" on the form tag rather than on the <input type="submit" /> tag. Ralph -- Posted via http://www.ruby-forum.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.
Ralph Shnelvar wrote:> Rob and Marnen: > > Thank you! > > I am now curious why the designers of HTML put the "place to go" on the > form tag rather than on the <input type="submit" /> tag. >My guess: the idea is that the action is a property of the *form*, not the submit button. But take this up on an HTML forum if you want better answers. We''re out of Rails territory here.> Ralph-- Posted via http://www.ruby-forum.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.
Rob Nichols wrote:> Marnen Laibow-Koser wrote: >> Whatever the <form> tag''s action is. > > Also, if no action is specified via the form tag, the form is submitted > to the current url. > > So if ''thing/edit/1'' contained: > > <form> > <input type="submit" /> > </form> > > The form would be submitted back to ''thing/edit/1''No. <form> without an action is invalid HTML, so its behavior is undefined. An action must always be specified. Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org Sent from my iPhone -- Posted via http://www.ruby-forum.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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser wrote:> Rob Nichols wrote: >> Marnen Laibow-Koser wrote: >>> Whatever the <form> tag''s action is. >> >> Also, if no action is specified via the form tag, the form is submitted >> to the current url. >> >> So if ''thing/edit/1'' contained: >> >> <form> >> <input type="submit" /> >> </form> >> >> The form would be submitted back to ''thing/edit/1'' > > No. <form> without an action is invalid HTML, so its behavior is > undefined. An action must always be specified. > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > > Sent from my iPhoneThank you for that comment on what should happen. However, the fact remains that if you don''t specify a target action, browsers will send the submitted data to the current url. Don''t confuse ''must'' with ''should''. -- Posted via http://www.ruby-forum.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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 8 July 2010 09:04, Rob Nichols <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Marnen Laibow-Koser wrote: >> Rob Nichols wrote: >>> Marnen Laibow-Koser wrote: >>>> Whatever the <form> tag''s action is. >>> >>> Also, if no action is specified via the form tag, the form is submitted >>> to the current url. >>> >>> So if ''thing/edit/1'' contained: >>> >>> <form> >>> <input type="submit" /> >>> </form> >>> >>> The form would be submitted back to ''thing/edit/1'' >> >> No. <form> without an action is invalid HTML, so its behavior is >> undefined. An action must always be specified. >> >... > Thank you for that comment on what should happen. However, the fact > remains that if you don''t specify a target action, browsers will send > the submitted data to the current url. Don''t confuse ''must'' with > ''should''.How do you know that the next version of FF will do that? Have you tested all available browsers? What about Chinese versions? If you develop a website that does not generate valid html then next week an update to IE may break the website and your clients/users will not be happy. 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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 8 July 2010 09:04, Rob Nichols <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Marnen Laibow-Koser wrote: >> No. <form> without an action is invalid HTML, so its behavior is >> undefined. An action must always be specified. > > Thank you for that comment on what should happen. However, the fact > remains that if you don''t specify a target action, browsers will send > the submitted data to the current url. Don''t confuse ''must'' with > ''should''.Yet you make the mistake yourself by saying "browsers will" instead of "browsers *may*". What action the user agent performs if an ''action'' parameter of a form is anything other than an http(s):// url is undefined... so they''re free to do what they want. http://www.w3.org/TR/html401/interact/forms.html#h-17.3 If *you* want to be *sure* a form submits how you want, you *must* include an action parameter. If you don''t care what your form does, then you *should* do whatever you prefer :-) -- 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.
On 8 July 2010 09:09, Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> If you > develop a website that does not generate valid html then next week an > update to IE may break the website and your clients/users will not be > happy.*ahem* one may develop websites with valid html and *this* week, and find the current IE will break it! ;-) Joking aside - if you don''t produce valid html and css (or fail to follow any other standards) one''s sites are much less likely to work on a variety of browsers. On the flip side, if you *do* endeavour to produce as valid markup as possible, you may be pleased to see your site render more closely to your intention in browsers you never even dreamed of testing on. -- 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 this and other forums I sometimes get the suggestion "Try it". I have made the comment in forums to the effect that "Just because it works does not mean that it is defined to work". -- Posted via http://www.ruby-forum.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.
Ralph Shnelvar wrote:> On this and other forums I sometimes get the suggestion "Try it". > > I have made the comment in forums to the effect that "Just because it > works does not mean that it is defined to work".That sounds like something I hear at work from time to time... "It is not known not to work"... -- Posted via http://www.ruby-forum.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.