gmoniey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Apr-18 05:53 UTC
trouble understanding rhtml forms
i dont understand where the following points to the actual post method: <% form_tag do -%> <p><label for="email">Email: </label><br/> <%= text_field_tag ''email'' %></p> <p><label for="password">Password</label><br/> <%= password_field_tag ''password'' %></p> <p><label for="remember_me">Remember me:</label> <%= check_box_tag ''remember_me'' %></p> <p><%= submit_tag ''Log in'' %></p> <% end -%> it seems to automatically direct to my login def in my controller, but i dont understand how. Could someone please clear this up thanks --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, gmoniey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > i dont understand where the following points to the actual post > method: > > <% form_tag do -%>I''m pretty sure it doesn''t. You''re missing the path in the form_tag which should look something like: <% form_tag ''controller/method'' do -%>> it seems to automatically direct to my login def in my controller, > but i dont understand how.I''m guessing you''ve probably got some code that takes non-logged-in visitors to that method / page to avoid unauthorized access. That would probably account for the behavior, although it seems to me that it would be better if this threw a syntax error instead. hth, Bill --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
gmoniey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Apr-18 16:55 UTC
Re: trouble understanding rhtml forms
Hi Bill, Thanks for the reply. I actually got this code from the act_as_authenticated plugin, and it doesn''t what i posted is exactly what is in the rhtml file, thats why i am struggling to figure out how it works. I seems like it is missing the controller/method tag as you mentioned, but it still figures things out. I guess I have just been struggling to figure out rails. I have went through some tutorials, but most of them are like: "look...it works!", where as I want to know why it works, how things are binded together, etc. On Apr 18, 6:31 am, "Bill Walton" <bill.wal...-xwVYE8SWAR3R7s880joybQ@public.gmane.org> wrote:> Hi, > > gmon...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > > i dont understand where the following points to the actual post > > method: > > > <% form_tag do -%> > > I''m pretty sure it doesn''t. You''re missing the path in the form_tag which > should look something like: > <% form_tag ''controller/method'' do -%> > > > it seems to automatically direct to my login def in my controller, > > but i dont understand how. > > I''m guessing you''ve probably got some code that takes non-logged-in visitors > to that method / page to avoid unauthorized access. That would probably > account for the behavior, although it seems to me that it would be better if > this threw a syntax error instead. > > hth, > Bill--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---