Hi all, I am trying to create a log-in page where the person logs in and based on where or not they entered the correct format for a password and email address, they may proceed to the next page. If, however, the check fails, they get kicked back to the log-in page. What I would like is to have the info (excluding their password and emailaddress which is what would make the log-in fail), be re-displayed in the form when they get kicked back. I have tried: redirect_to :action => ''traveler_form'', :id => params in my controller which I was hoping would just kick back the params hash, but it doesn''t work. Any ideas, thanks in advance, and thank God it''s Friday! ~S -- 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-/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 -~----------~----~----~----~------~----~------~--~---
<dirty_mode> before you redirect set a variable @login = params[:user_name] for example in your view you put as option in your text_field '':value => @login'' </dirty_mode> There is probably a better solution than this :-) Stijn -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Stijn Pint wrote:> <dirty_mode> > before you redirect set a variable @login = params[:user_name] for > example > in your view you put as option in your text_field '':value => @login'' > </dirty_mode> > > There is probably a better solution than this :-) > > StijnIt doesn''t take the value option. If I say: <%= text_field ''user'', ''company'', :value => @login %> it never shows the value attribute in the raw html. Is :value one of the ptions that you can pass to the text_field helper? -- 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-/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 -~----------~----~----~----~------~----~------~--~---
Shandy Nantz wrote:> Stijn Pint wrote: >> <dirty_mode> >> before you redirect set a variable @login = params[:user_name] for >> example >> in your view you put as option in your text_field '':value => @login'' >> </dirty_mode> >> >> There is probably a better solution than this :-) >> >> Stijn > > It doesn''t take the value option. If I say: > > <%= text_field ''user'', ''company'', :value => @login %> > > it never shows the value attribute in the raw html. Is :value one of the > ptions that you can pass to the text_field helper?Yes it does. problem is maybe that in your ''traveler_form'' action, you ''ll override this value. Are you doing maybe @user = User.new there ? That''s one of the reasons why it would be better not to do a redirect, but only a :render. Stijn -- 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-/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 -~----------~----~----~----~------~----~------~--~---