I have the following snippet in a controller. verify :params => "post", :only => [:create, :update, :destroy], :add_flash => {"notice" => "Invalid Access"}, :redirect_to => {:action => ''list''} If I directly access /posts/create by typing URL (GET), the program redirects to the "list" action, but the flash message I added is not shown in the redirected page. Any help would be appreciated. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
T K wrote:> I have the following snippet in a controller. > > verify :params => "post", :only => [:create, :update, :destroy], > :add_flash => {"notice" => "Invalid Access"}, :redirect_to => {:action > => ''list''} > > > If I directly access /posts/create by typing URL (GET), the program > redirects to the "list" action, but the flash message I added is not > shown in the redirected page. > > > Any help would be appreciated. > > >Do you usually get flash messages from other sources? (i.e. do you have <%= flash[:notice] %> somewhere in your layout?) -- http://www.5valleys.com/ http://www.workingwithrails.com/person/8078 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
T K wrote:> I have the following snippet in a controller. > > verify :params => "post", :only => [:create, :update, :destroy], > :add_flash => {"notice" => "Invalid Access"}, :redirect_to => {:action > => ''list''}I''m pretty sure the proper key is :flash and not :add_flash. http://api.rubyonrails.com/classes/ActionController/Verification/ClassMethods.html#M000307 -- 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 -~----------~----~----~----~------~----~------~--~---
Daniel Waite wrote:> T K wrote: >> I have the following snippet in a controller. >> >> verify :params => "post", :only => [:create, :update, :destroy], >> :add_flash => {"notice" => "Invalid Access"}, :redirect_to => {:action >> => ''list''} > > I''m pretty sure the proper key is :flash and not :add_flash. > > http://api.rubyonrails.com/classes/ActionController/Verification/ClassMethods.html#M000307Ha! Maybe I should read my own links. :) I''ve never seen the add_flash directive. In that case, I dunno. How/where are you calling flash in your views? -- 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 -~----------~----~----~----~------~----~------~--~---