Re: REST urls and Authenticity Token

Michael Rigart
Mon, 19 May 2008 12:15:06 -0000

Michael Rigart wrote:
> <%= link_to image_tag(''icons/folder_delete.png''),
{:url =>
> folder_path(folder) }, { :method => :delete, :title =>
''Delete this
> folder'', :confirm => "All files and subfolders will be
deleted!\nAre you
> sure?" } %>

Forming the link like this

<%= link_to image_tag(''icons/folder_delete.png''), {:action
=> ''destroy'',
:id => folder }, { :method => :delete, :title => ''Delete this
folder'',
:confirm => "All files and subfolders will be deleted!\nAre you
sure?" }
%>

seems to work. But sometims I still get the Authenticity Token error.
After a page refresh, everything is back in order. Can this be due to my
redirect?