Sharma Chelluri
2007-Mar-01 12:52 UTC
diffrnce between flash[:message] and flash[:notice] and ..
Hi, How could i learn the diffrence between flash[:message] and flash[:notice] and flash[:warning]. In the global layout of any rails project..scafflod is only put flash[:notice]. If i declare flash[:message].. its not displaying on top.. Can any one point me to right tutorials on this flash objct and error handling..? Thanks in advance, sharma -- 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 -~----------~----~----~----~------~----~------~--~---
Joram
2007-Mar-01 12:57 UTC
Re: diffrnce between flash[:message] and flash[:notice] and ..
There is no difference between them. The flash is basically a hash, where values are retrieved by using a key. so flash[:notice] gives you the value that belongs to notice, flash[:something] gives you the value corresponding to the key :something. This means that in your controller you can do: def some_method flash[:otice] = ''this is a notice'' flash[:something_else] = ''this is something else] end which you can use in your view: <%= flash[:notice] %> <%= flash[:something_else %> I was first also confused about the flash, I hope this helps On 1 mrt, 13:52, Sharma Chelluri <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > How could i learn the diffrence between flash[:message] and > flash[:notice] and flash[:warning]. > > In the global layout of any rails project..scafflod is only put > flash[:notice]. If i declare flash[:message].. its not displaying on > top.. > > Can any one point me to right tutorials on this flash objct and error > handling..? > > Thanks in advance, > sharma > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Joram
2007-Mar-01 12:58 UTC
Re: diffrnce between flash[:message] and flash[:notice] and ..
off course some typos : controller has to be : def some_method flash[:notice] = ''this is a notice'' flash[:something_else] = ''this is something else'' end On 1 mrt, 13:57, "Joram" <joram.bar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> There is no difference between them. > > The flash is basically a hash, where values are retrieved by using a > key. > > so flash[:notice] gives you the value that belongs to notice, > flash[:something] gives you the value corresponding to the > key :something. > > This means that in your controller you can do: > > def some_method > flash[:otice] = ''this is a notice'' > flash[:something_else] = ''this is something else] > end > > which you can use in your view: > > <%= flash[:notice] %> > <%= flash[:something_else %> > > I was first also confused about the flash, I hope this helps > > On 1 mrt, 13:52, Sharma Chelluri <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > Hi, > > > How could i learn the diffrence between flash[:message] and > > flash[:notice] and flash[:warning]. > > > In the global layout of any rails project..scafflod is only put > > flash[:notice]. If i declare flash[:message].. its not displaying on > > top.. > > > Can any one point me to right tutorials on this flash objct and error > > handling..? > > > Thanks in advance, > > sharma > > > -- > > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
If you look at the code generated by the scaffold, you''ll notice that flash[:notice] in methods and corresponding views. When you change to :message, you have to change both views/layouts and controllers. On Mar 1, 7:52 am, Sharma Chelluri <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi, > > How could i learn the diffrence between flash[:message] and > flash[:notice] and flash[:warning]. > > In the global layout of any rails project..scafflod is only put > flash[:notice]. If i declare flash[:message].. its not displaying on > top.. > > Can any one point me to right tutorials on this flash objct and error > handling..? > > Thanks in advance, > sharma > > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
David Dumaresq
2007-Mar-01 16:40 UTC
Re: diffrnce between flash[:message] and flash[:notice] and ..
It might also be worth mentioning that flash by default has the special property of making the hash available to the next action only (e.g. flash[:notice]=''Item was moved to the trash''). After that it is removed from the session. Check out flash.keep, flash.now, and flash.discard in the API docs. Regards, Dave _______________________________ Information and Educational Technology Kwantlen University College - 604-599-2120 "So powerful is the light of unity that it can illuminate the whole earth." --Bahá''u''lláh rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org wrote on 01/03/2007 05:15:26 AM:> > If you look at the code generated by the scaffold, you''ll notice that > flash[:notice] in methods and corresponding views. When you change > to :message, you have to change both views/layouts and controllers. > > > On Mar 1, 7:52 am, Sharma Chelluri <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > Hi, > > > > How could i learn the diffrence between flash[:message] and > > flash[:notice] and flash[:warning]. > > > > In the global layout of any rails project..scafflod is only put > > flash[:notice]. If i declare flash[:message].. its not displaying on > > top.. > > > > Can any one point me to right tutorials on this flash objct and error > > handling..? > > > > Thanks in advance, > > sharma > > > > -- > > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---