in the case of invalid login, the method bellow does nothing at flash[:error], just goes directly to =>welcome page. is something missing something? def process_login if user = User.authenticate(params[:user]) session[:id] = user.id redirect_to session[:return_to] || ''/'' else flash[:error] = "Invalid login." puts ''error'' redirect_to :controller => ''main'', :action => ''welcome'', :username => params[:user][:username] end end in *.erb code is as follows <% if flash[:message] %> <div><%= flash[:message] %></div> <% end %> <% if flash[:error] %> <div><%= flash[:error] %></div> <% end %> --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
anti wrote:>>in *.erb code is as followsIs it really in all of your .erb files? In a layout file? If I understand correctly, you''re expecting it to show the error on the welcome page, yes? If so, is the flash stuff in the Welcome.html.erb file, or the layout it uses? jp -- 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 -~----------~----~----~----~------~----~------~--~---
anti wrote:> in the case of invalid login, the method bellow does nothing at > flash[:error], just goes directly to =>welcome page. > is something missing something?How is the "welcome" action in your "main" controller defined? What entries are there in your log file during invalid login processing (at least processing, parameter and rendering lies)? -- 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 -~----------~----~----~----~------~----~------~--~---
anti wrote:> in the case of invalid login, the method bellow does nothing at > flash[:error], just goes directly to =>welcome page. > is something missing something? > > def process_login > if user = User.authenticate(params[:user]) > session[:id] = user.id > redirect_to session[:return_to] || ''/'' > else > flash[:error] = "Invalid login." > puts ''error'' > redirect_to :controller => ''main'', :action => > ''welcome'', :username => params[:user][:username] > end > end > > in *.erb code is as follows > > <% if flash[:message] %> > <div><%= flash[:message] %></div> > <% end %> > > <% if flash[:error] %> > <div><%= flash[:error] %></div> > <% end %>hi anti... the prob here is u have to specify even the id of the div it should be probably like this try once <div id= ''error''><%= flash[:error] %></div> -- 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 -~----------~----~----~----~------~----~------~--~---
this is it.> If I understand correctly, you''re expecting it to show theerroron the > welcome page, yes? If so, is theflashstuff in the Welcome.html.erb > file, or the layout it uses? >theflashstuff has to be on the destination page, welcome.html.erb in this case. theflashstuff goes on the same page when the action is to itself. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
this is it.> If I understand correctly, you''re expecting it to show theerroron the > welcome page, yes? If so, is theflashstuff in the Welcome.html.erb > file, or the layout it uses? >theflashstuff has to be on the destination page, welcome.html.erb in this case. theflashstuff goes on the same page when the action is to itself. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---