# Undefined method \`protect\_against\_forgery?'

**URL:** <https://www.ruby-forum.com/t/undefined-method-protect-against-forgery/175283>\
**Category:** Rails\
**Created:** [September 10, 2009, 3:58pm UTC](https://www.ruby-forum.com/t/undefined-method-protect-against-forgery/175283 "2009-09-10T15:58:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sunnet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8491ac/32.png) [@sunnet](https://www.ruby-forum.com/u/sunnet)\
**Post date:** [September 10, 2009, 3:58pm UTC](https://www.ruby-forum.com/t/undefined-method-protect-against-forgery/175283/1 "2009-09-10T15:58:28Z")

</div>

When I use plugin ‘railstree’ ([http://www.hashcode.eti.br/?p=91](http://www.hashcode.eti.br/?p=91)) as  
following code:  
node = Node.new :label =\> menu\_item.name,  
:link\_to\_remote =\> {  
:base =\> self,  
:update =\>  
“container”,  
:url =\> {  
:controller  
=\> menu\_item.controller,  
:action  
=\> menu\_item.action  
}  
}

there is a error as following:  
undefined method `protect\_against\_forgery?’ for #Node:0xb66986b8

/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action\_view/  
helpers/prototype\_helper.rb:1059:in `options_for_ajax' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_view/ helpers/prototype_helper.rb:449:in `remote\_function’  
/home/sdr/workspace/sp/vendor/plugins/tree/lib/node.rb:79:in  
`internal_link_to_remote' /home/sdr/workspace/sp/vendor/plugins/tree/lib/node.rb:31:in `initialize’  
/home/sdr/workspace/sp/app/controllers/application\_controller.rb:59:in  
`new' /home/sdr/workspace/sp/app/controllers/application_controller.rb:59:in `add\_children’  
/home/sdr/workspace/sp/app/controllers/application\_controller.rb:45:in  
`set_sidemenu' /home/sdr/workspace/sp/app/controllers/application_controller.rb:44:in `each’  
/home/sdr/workspace/sp/app/controllers/application\_controller.rb:44:in  
`set\_sidemenu’

what should I do ??

Thanks.

---

<div class="post-metadata">

**Author:** ![sunnet](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8491ac/32.png) [@sunnet](https://www.ruby-forum.com/u/sunnet)\
**Post date:** [September 10, 2009, 8:26pm UTC](https://www.ruby-forum.com/t/undefined-method-protect-against-forgery/175283/2 "2009-09-10T20:26:01Z")

</div>

On Sep 10, 8:56 am, sunnet [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> :action
> 
> ```
> 
> helpers/prototype\_helper.rb:449:in `remote_function' /home/sdr/workspace/sp/app/controllers/application_controller.rb:44:in `each’  
> /home/sdr/workspace/sp/app/controllers/application\_controller.rb:44:in  
> `set\_sidemenu’
> 
> what should I do ??
> 
> Thanks.

Hello Sunnet and All Who Post Messages Like This,

> what should I do ??

Try Google?

Try reading the docs on protect\_from\_forgery to learn what it does and  
why you might be getting this error?

Try reading the railstree source code to narrow down the error?

Tell us what you’ve tried so far?

Jeff
