Forum: Ruby on Rails Error "ActionController::InvalidAuthenticityToken"

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3d9e26d3be3e7fcf93aca6574bc77a20?d=identicon&s=25 Tushar Gandhi (gandhi-tush)
on 2009-04-13 12:48
Hi,
I am using rails 2.2
I an getting this error.
"ActionController::InvalidAuthenticityToken"

I have an code in my erb file is like this:

<div style="float:left;border:1px solid red;width:200px;height:250px;">

    <div id="pdf_title" style="display:none">
      Title: <%=text_field(:page, :title, :size => 20)%>
      <a href="#" onclick="add_title();">Create</a>
    </div>
  <script>
  function page_title(){
    $('pdf_title').style.display='block';
  }
  function add_title(){
    var pdf_title=$('page_title').value;
    //alert(pdf_title);
    var url="face/add_title"
    new Ajax.Updater('', url, {asynchronous:true,
evalScripts:true,onComplete:function(request){reset_div();},parameters:{page_title:
pdf_title }});
  }

</script>

Whenever I am clicking onto the Create link I am getting error.
"ActionController::InvalidAuthenticityToken"
Could any one please help me out urgently.
I am new in rails 2.0 and above
Thanks,
Tushar
This topic is locked and can not be replied to.