# Protect\_against\_forgery? not available as helper method for views

**URL:** <https://www.ruby-forum.com/t/protect-against-forgery-not-available-as-helper-method-for-views/149903>\
**Category:** Rails\
**Created:** [September 30, 2008, 11:47pm UTC](https://www.ruby-forum.com/t/protect-against-forgery-not-available-as-helper-method-for-views/149903 "2008-09-30T23:47:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![suntou](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/898d66/32.png) [@suntou](https://www.ruby-forum.com/u/suntou)\
**Post date:** [September 30, 2008, 11:47pm UTC](https://www.ruby-forum.com/t/protect-against-forgery-not-available-as-helper-method-for-views/149903/1 "2008-09-30T23:47:49Z")

</div>

I recently upgrade to rails 2.1.1 from rails 1.2.3. When I create a  
form, it generates this error when the form is displayed:

undefined method `protect\_against\_forgery?’ for #\<ActionView::Base:  
0x30cbd9c\>

Extracted source (around line #5):

2:  
3: Thank you for signing up at [Specool.com](http://Specool.com). Your first time login  
must be from within this email to properly activate your account.  
After that, you may login directly at [specool.com](http://specool.com).  
4:  
5: \<% form\_tag :controller =\> “user”, :action=\> “login” do %\>  
6:

### Login
  
7:  
8: Login email:  

RAILS\_ROOT: /Users/jianshen/jedmin/working\_copies/qa\_feature\_site  
Application Trace | Framework Trace | Full Trace

/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action\_view/  
helpers/form\_tag\_helper.rb:433:in `extra_tags_for_form' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/ helpers/form_tag_helper.rb:441:in `form\_tag\_html’  
/usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action\_view/  
helpers/form\_tag\_helper.rb:447:in `form_tag_in_block' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/lib/action_view/ helpers/form_tag_helper.rb:39:in `form\_tag’  
app/views/notification/signup\_validation.erb:5:in  
`_run_erb_47app47views47notification47signup_validation46erb' app/controllers/user_controller.rb:25:in `signup’  
/usr/local/bin/mongrel\_rails:16:in `load’  
/usr/local/bin/mongrel\_rails:16

I know protect\_against\_forgery? is defined in  
ActionController::RequestForgeryProtection, but no where I can find it  
is defined as a helper.

It is called from /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.1.1/  
lib/action\_view/helpers/form\_tag\_helper.rb so I assume that this  
should be available to all views. Maybe I didn’t loaded something  
correctly?

Help is much appreciated!

John
