T_K
May 20, 2008, 4:21pm
1
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.
T_K
May 20, 2008, 5:33pm
2
T K wrote:
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
T_K
May 20, 2008, 9:26pm
3
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
T_K
May 20, 2008, 9:28pm
4
Daniel W. 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.
Peak Obsession
Ha! 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?