Help with form_for

Hello, I had an app running on RoR 1.1, now I’m migrating it to 2.1.

In a view I have:

Please log in <% form_for(:user, :url => sessions_path) do |f| %>

Username: <%= flash[:notice]%>

<%= f.text_field :username %>

Password:

<%= f.password_field :password %> <%= submit_tag 'Go!'%>

Register <%= link_to 'New user?', new_user_path %>

<% end %>

Rendering it, the server gives this error, but I don’t know what it
means. Any idea?

wrong argument type FalseClass (expected Proc)

Extracted source (around line #4):

1:


2:
3: Please log in
4: <% form_for(:user, :url => {:action => :create}) do |f| %>
5:

Username: <%= flash[:notice]%></
span>


6: <%= f.text_field :username %>
7:

Password:

RAILS_ROOT: /home/eyp/workspace/lists
Application Trace | Framework Trace | Full Trace

(eval):2:in protect_against_forgery?' app/views/sessions/new.rhtml:4:in_run_erb_47app47views47sessions47new46rhtml’

/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/helpers/
form_tag_helper.rb:431:in extra_tags_for_form' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/helpers/ form_tag_helper.rb:439:inform_tag_html’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/helpers/
form_tag_helper.rb:41:in form_tag' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/helpers/ form_helper.rb:252:inform_for’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/base.rb:
338:in send' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/base.rb: 338:inexecute’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/
template_handlers/compilable.rb:29:in send' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/ template_handlers/compilable.rb:29:inrender’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/
template.rb:35:in render' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/ template.rb:22:inrender_template’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/base.rb:
245:in render_file' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ base.rb:1108:inrender_for_file’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:841:in render_with_no_layout' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ layout.rb:251:inrender_without_benchmark’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
benchmarking.rb:51:in render' /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ core_ext/benchmark.rb:8:inrealtime’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
benchmarking.rb:51:in render' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ base.rb:1157:indefault_render’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:1163:in perform_action_without_filters' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ filters.rb:580:incall_filters’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
filters.rb:573:in perform_action_without_benchmark' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
rescue.rb:201:in perform_action_without_caching' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ caching/sql_cache.rb:13:inperform_action’
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/query_cache.rb:33:in cache' /usr/lib64/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/ query_cache.rb:8:incache’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
caching/sql_cache.rb:12:in perform_action' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ base.rb:529:insend’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:529:in process_without_filters' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ filters.rb:569:inprocess_without_session_management_support’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
session_management.rb:130:in process' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ base.rb:389:inprocess’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:149:in handle_request' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatcher.rb:107:indispatch’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:104:in synchronize' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatcher.rb:104:indispatch’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:120:in dispatch_cgi' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatcher.rb:35:indispatch’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in
process' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:insynchronize’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in
process' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:inprocess_client’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
each' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:inprocess_client’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
run' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:ininitialize’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
new' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:inrun’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
initialize' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:innew’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
run' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:282:inrun’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
configurator.rb:281:in each' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:281:inrun’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in
run' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb: 212:inrun’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:502:in load' /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ dependencies.rb:502:inload’
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:354:in new_constants_in' /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ dependencies.rb:502:inload’
/usr/lib64/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/
mongrel.rb:64
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:509:in require' /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ dependencies.rb:354:innew_constants_in’
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:509:in require' /usr/lib64/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
script/server:3

(eval):2:in protect_against_forgery?' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/helpers/ form_tag_helper.rb:431:inextra_tags_for_form’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/helpers/
form_tag_helper.rb:439:in form_tag_html' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/helpers/ form_tag_helper.rb:41:inform_tag’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/helpers/
form_helper.rb:252:in form_for' app/views/sessions/new.rhtml:4:in_run_erb_47app47views47sessions47new46rhtml’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/base.rb:
338:in send' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/base.rb: 338:inexecute’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/
template_handlers/compilable.rb:29:in send' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/ template_handlers/compilable.rb:29:inrender’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/
template.rb:35:in render' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/ template.rb:22:inrender_template’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_view/base.rb:
245:in render_file' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ base.rb:1108:inrender_for_file’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:841:in render_with_no_layout' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ layout.rb:251:inrender_without_benchmark’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
benchmarking.rb:51:in render' /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ core_ext/benchmark.rb:8:inrealtime’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
benchmarking.rb:51:in render' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ base.rb:1157:indefault_render’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:1163:in perform_action_without_filters' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ filters.rb:580:incall_filters’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
filters.rb:573:in perform_action_without_benchmark' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib/ruby/1.8/benchmark.rb:293:in measure' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ benchmarking.rb:68:inperform_action_without_rescue’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
rescue.rb:201:in perform_action_without_caching' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ caching/sql_cache.rb:13:inperform_action’
/usr/lib64/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/
connection_adapters/abstract/query_cache.rb:33:in cache' /usr/lib64/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/ query_cache.rb:8:incache’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
caching/sql_cache.rb:12:in perform_action' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ base.rb:529:insend’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
base.rb:529:in process_without_filters' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ filters.rb:569:inprocess_without_session_management_support’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
session_management.rb:130:in process' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ base.rb:389:inprocess’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:149:in handle_request' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatcher.rb:107:indispatch’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:104:in synchronize' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatcher.rb:104:indispatch’
/usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
dispatcher.rb:120:in dispatch_cgi' /usr/lib64/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/ dispatcher.rb:35:indispatch’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:76:in
process' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:insynchronize’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/rails.rb:74:in
process' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:inprocess_client’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
each' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:inprocess_client’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
run' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:ininitialize’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
new' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:inrun’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
initialize' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:innew’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
run' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:282:inrun’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/
configurator.rb:281:in each' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/ configurator.rb:281:inrun’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in
run' /usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb: 212:inrun’
/usr/lib64/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:502:in load' /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ dependencies.rb:502:inload’
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:354:in new_constants_in' /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ dependencies.rb:502:inload’
/usr/lib64/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/servers/
mongrel.rb:64
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
gem_original_require' /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:509:in require' /usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/ dependencies.rb:354:innew_constants_in’
/usr/lib64/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/
dependencies.rb:509:in require' /usr/lib64/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/server.rb:39 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require’
script/server:3

It seems that was nothing, today a new update for ruby 1.8.6 on Fedora
8 has resolved the issue! :). After updating, all wroked fine, again.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs