marai
2006-Sep-07 11:07 UTC
[error:flash function] message will not be displayed on some condition.
Hello fellows. I have a issue on Ruby regarding error notice function (Flash). The error message will not be displayed on some condition. This issue occurs on the system which I wrote below. (There is no problem when I am using local PC enviornment "WEBrick") Specifically, the issue is, There is no problem displaying the value from flash when the controler is set for error notice view. However, when I set the value on other controler such as "application.rb" the value will not show up. Below is my system enviornment and the source code that I wrote for ROR and rhtml. System enviornment Red Hat Enterprise Linux 4.0 ES Apache 2.0.52 MySQL 4.1.20 modssl 2.0.52 / fastcgi Ruby 1.8.4 Rails 1.1.6 The source code I wrote follows Ruby on Rails source code; flash[:notice] = ''error message'' rhtml source code; <% if @flash[:notice] %> <%= @flash[:notice] %> <% end %> Please help me!! Best Regards, marai --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Daniel N
2006-Sep-07 23:48 UTC
Re: [error:flash function] message will not be displayed on some condition.
On 9/7/06, marai <marai.ceo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > The source code I wrote follows > > Ruby on Rails source code; > flash[:notice] = ''error message'' > > rhtml source code; > <% if @flash[:notice] %> > <%= @flash[:notice] %> > <% end %> > > You shouldn''t use the @flash variable directly. This is depricated.Aslo, once the flash is accessed i believe it''s cleared. You could use something like <% if fl = flash[:notice] %> <%= fl %> <% end %> Alternatively there are a number of solutions to displaying the flash messages. One off hand is, http://rails.techno-weenie.net/tip/2006/7/13/another-flash-display-helper Hope that helps --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
marai
2006-Sep-08 09:48 UTC
Re: [error:flash function] message will not be displayed on some condition.
Daniel N, Thank you for your help and advice. I''ll try it.> You shouldn''t use the @flash variable directly. This is depricated. >Aslo, once the flash is accessed i believe it''s cleared.>You could use something like><% if fl = flash[:notice] %> ><%= fl %> ><% end %>>Alternatively there are a number of solutions to displaying the flash >messages. One off hand is, >http://rails.techno-weenie.net/tip/2006/7/13/another-flash-display-he...Best Regards marai --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---