Ruby noob here. Just installed Rails 2.0, and am having trouble with updating DB tables, using the ApplicationController. My ApplicationController file looks like: class StoryController < ApplicationController protect_from_forgery :only => [:create, :update, :destroy] scaffold :story #def index #@current_time = Time.now #@story = Story.find_by_name(''arc'') #end end But when I go to the browser to update the file I get: ActionController::InvalidAuthenticityToken in StoryController#create ActionController::InvalidAuthenticityToken The tmp/sessions directory is empty and the environment.rb file has: config.action_controller.session = { :session_key => ''_digg_session'', :secret => ''cc86e984ae6e2b376f9328a73f4df2555a9f96970553b2fa4bb17cc04192c64b24a86c166aa69392100586b0ebd8c6715839bc8a3576b549b13d3157f615ddba'' } The trace is below: /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `send!'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:441:in `run'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:716:in `run_before_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:695:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:689:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/rescue.rb:199:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:678:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/query_cache.rb:33:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ query_cache.rb:8:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:677:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:685:in `process_without_session_management_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/session_management.rb:123:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:388:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:171:in `handle_request'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:115:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:126:in `dispatch_cgi'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:9:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 112:in `handle_dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 78:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 62:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ webrick.rb:66 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: 39 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `send!'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:441:in `run'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:716:in `run_before_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:695:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:689:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/rescue.rb:199:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:678:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/query_cache.rb:33:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ query_cache.rb:8:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:677:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:685:in `process_without_session_management_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/session_management.rb:123:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:388:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:171:in `handle_request'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:115:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:126:in `dispatch_cgi'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:9:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 112:in `handle_dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 78:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 62:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ webrick.rb:66 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: 39 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 Request Parameters: {"commit"=>"Create story", "story"=>{"name"=>"Digg", "updated_at(1i)"=>"2008", "created_at(1i)"=>"2008", "updated_at(2i)"=>"1", "created_at(2i)"=>"1", "updated_at(3i)"=>"6", "created_at(3i)"=>"6", "updated_at(4i)"=>"01", "created_at(4i)"=>"01", "updated_at(5i)"=>"55", "created_at(5i)"=>"55", "link"=>"www.digg.com"}} Show session dump --- :csrf_id: 7cc001388388e0df08f578db3c990f89 flash: !map:ActionController::Flash::FlashHash {} Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Do you generate your forms by hand or do you use the appropriate helpers? On Jan 6, 10:56 am, Harpoon <cs3...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Ruby noob here. > Just installed Rails 2.0, and am having trouble with updating DB > tables, using the ApplicationController. > > My ApplicationController file looks like: > > class StoryController < ApplicationController > protect_from_forgery :only => > [:create, :update, :destroy] > scaffold :story > #def index > #@current_time = Time.now > #@story = Story.find_by_name(''arc'') > #end > end > > But when I go to the browser to update the file I get: > > ActionController::InvalidAuthenticityToken in StoryController#create > ActionController::InvalidAuthenticityToken > > The tmp/sessions directory is empty and the environment.rb file has: > > config.action_controller.session = { > :session_key => ''_digg_session'', > :secret => > ''cc86e984ae6e2b376f9328a73f4df2555a9f96970553b2fa4bb17cc04192c64b24a86c166a a69392100586b0ebd8c6715839bc8a3576b549b13d3157f615ddba'' > } > > The trace is below: > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/request_forgery_protection.rb:79:in > `verify_authenticity_token'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:469:in `send!'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:469:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:441:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:716:in `run_before_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:695:in `call_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:689:in `perform_action_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/rescue.rb:199:in `perform_action_without_caching'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/caching.rb:678:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > connection_adapters/abstract/query_cache.rb:33:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > query_cache.rb:8:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/caching.rb:677:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:524:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:524:in `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:685:in > `process_without_session_management_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/session_management.rb:123:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:388:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:171:in `handle_request'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:115:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:126:in `dispatch_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:9:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 112:in `handle_dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 78:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 62:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ > webrick.rb:66 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: > 39 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > script/server:3 > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/request_forgery_protection.rb:79:in > `verify_authenticity_token'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:469:in `send!'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:469:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:441:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:716:in `run_before_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:695:in `call_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:689:in `perform_action_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/rescue.rb:199:in `perform_action_without_caching'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/caching.rb:678:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > connection_adapters/abstract/query_cache.rb:33:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ > query_cache.rb:8:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/caching.rb:677:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:524:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:524:in `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:685:in > `process_without_session_management_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/session_management.rb:123:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:388:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:171:in `handle_request'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:115:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:126:in `dispatch_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:9:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 112:in `handle_dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 78:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 62:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ > webrick.rb:66 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: > 39 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > script/server:3 > > Request > > Parameters: > > {"commit"=>"Create story", > "story"=>{"name"=>"Digg", > "updated_at(1i)"=>"2008", > "created_at(1i)"=>"2008", > "updated_at(2i)"=>"1", > "created_at(2i)"=>"1", > "updated_at(3i)"=>"6", > "created_at(3i)"=>"6", > "updated_at(4i)"=>"01", > "created_at(4i)"=>"01", > "updated_at(5i)"=>"55", > "created_at(5i)"=>"55", > "link"=>"www.digg.com"}} > > Show session dump > > --- > :csrf_id: 7cc001388388e0df08f578db3c990f89 > flash: !map:ActionController::Flash::FlashHash {} > > Response > > Headers: > > {"cookie"=>[], > "Cache-Control"=>"no-cache"}--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ruby noob here. Just installed Rails 2.0, and am having trouble with updating DB tables, using the ApplicationController. The controller was generated using the command: rake db:migrate ruby script/generate controller Story index My ApplicationController file looks like: class StoryController < ApplicationController protect_from_forgery :only => [:create, :update, :destroy] scaffold :story #def index #@current_time = Time.now #@story = Story.find_by_name(''arc'') #end end But when I go to the browser to update the file I get: ActionController::InvalidAuthenticityToken in StoryController#create ActionController::InvalidAuthenticityToken The tmp/sessions directory is empty and the environment.rb file has: config.action_controller.session = { :session_key => ''_digg_session'', :secret => ''cc86e984ae6e2b376f9328a73f4df2555a9f96970553b2fa4bb17cc04192c64b24a86c166aa69392100586b0ebd8c6715839bc8a3576b549b13d3157f615ddba'' } The trace is below: /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `send!'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:441:in `run'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:716:in `run_before_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:695:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:689:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/rescue.rb:199:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:678:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/query_cache.rb:33:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ query_cache.rb:8:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:677:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:685:in `process_without_session_management_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/session_management.rb:123:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:388:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:171:in `handle_request'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:115:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:126:in `dispatch_cgi'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:9:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 112:in `handle_dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 78:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 62:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ webrick.rb:66 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: 39 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `send!'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:441:in `run'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:716:in `run_before_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:695:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:689:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/rescue.rb:199:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:678:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/query_cache.rb:33:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ query_cache.rb:8:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:677:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:685:in `process_without_session_management_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/session_management.rb:123:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:388:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:171:in `handle_request'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:115:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:126:in `dispatch_cgi'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:9:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 112:in `handle_dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 78:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 62:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ webrick.rb:66 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: 39 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 Request Parameters: {"commit"=>"Create story", "story"=>{"name"=>"Digg", "updated_at(1i)"=>"2008", "created_at(1i)"=>"2008", "updated_at(2i)"=>"1", "created_at(2i)"=>"1", "updated_at(3i)"=>"6", "created_at(3i)"=>"6", "updated_at(4i)"=>"01", "created_at(4i)"=>"01", "updated_at(5i)"=>"55", "created_at(5i)"=>"55", "link"=>"www.digg.com"}} Show session dump --- :csrf_id: 7cc001388388e0df08f578db3c990f89 flash: !map:ActionController::Flash::FlashHash {} Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Ruby noob here. Just installed Rails 2.0, and am having trouble with updating DB tables, using the ApplicationController. The controller was generated using the command: rake db:migrate ruby script/generate controller Story index My ApplicationController file looks like: class StoryController < ApplicationController protect_from_forgery :only => [:create, :update, :destroy] scaffold :story #def index #@current_time = Time.now #@story = Story.find_by_name(''arc'') #end end But when I go to the browser to update the file I get: ActionController::InvalidAuthenticityToken in StoryController#create ActionController::InvalidAuthenticityToken The tmp/sessions directory is empty and the environment.rb file has: config.action_controller.session = { :session_key => ''_digg_session'', :secret => ''cc86e984ae6e2b376f9328a73f4df2555a9f96970553b2fa4bb17cc04192c64b24a86c166aa69392100586b0ebd8c6715839bc8a3576b549b13d3157f615ddba'' } The trace is below: /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `send!'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:441:in `run'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:716:in `run_before_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:695:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:689:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/rescue.rb:199:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:678:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/query_cache.rb:33:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ query_cache.rb:8:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:677:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:685:in `process_without_session_management_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/session_management.rb:123:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:388:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:171:in `handle_request'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:115:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:126:in `dispatch_cgi'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:9:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 112:in `handle_dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 78:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 62:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ webrick.rb:66 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: 39 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/request_forgery_protection.rb:79:in `verify_authenticity_token'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `send!'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:469:in `call'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:441:in `run'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:716:in `run_before_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:695:in `call_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:689:in `perform_action_without_benchmark'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/benchmarking.rb:68:in `perform_action_without_rescue'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/rescue.rb:199:in `perform_action_without_caching'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:678:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ connection_adapters/abstract/query_cache.rb:33:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/active_record/ query_cache.rb:8:in `cache'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/caching.rb:677:in `perform_action'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `send'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:524:in `process_without_filters'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/filters.rb:685:in `process_without_session_management_support'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/session_management.rb:123:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/base.rb:388:in `process'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:171:in `handle_request'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:115:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:126:in `dispatch_cgi'' /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ action_controller/dispatcher.rb:9:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 112:in `handle_dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 78:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: 62:in `dispatch'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ webrick.rb:66 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:342:in `new_constants_in'' /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/dependencies.rb:496:in `require'' /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: 39 /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' script/server:3 Request Parameters: {"commit"=>"Create story", "story"=>{"name"=>"Digg", "updated_at(1i)"=>"2008", "created_at(1i)"=>"2008", "updated_at(2i)"=>"1", "created_at(2i)"=>"1", "updated_at(3i)"=>"6", "created_at(3i)"=>"6", "updated_at(4i)"=>"01", "created_at(4i)"=>"01", "updated_at(5i)"=>"55", "created_at(5i)"=>"55", "link"=>"www.digg.com"}} Show session dump --- :csrf_id: 7cc001388388e0df08f578db3c990f89 flash: !map:ActionController::Flash::FlashHash {} Response Headers: {"cookie"=>[], "Cache-Control"=>"no-cache"} -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Did you read Kitto''s response to you yesterday ? Fred On 7 Jan 2008, at 02:30, Harp Oon wrote:> > > > Ruby noob here. > > Just installed Rails 2.0, and am having trouble with updating DB > tables, using the ApplicationController. > > The controller was generated using the command: > rake db:migrate > ruby script/generate controller Story index > > > My ApplicationController file looks like: > > class StoryController < ApplicationController > protect_from_forgery :only => > [:create, :update, :destroy] > scaffold :story > #def index > #@current_time = Time.now > #@story = Story.find_by_name(''arc'') > #end > end > > But when I go to the browser to update the file I get: > > ActionController::InvalidAuthenticityToken in StoryController#create > ActionController::InvalidAuthenticityToken > > The tmp/sessions directory is empty and the environment.rb file has: > > config.action_controller.session = { > :session_key => ''_digg_session'', > :secret => > ''cc86e984ae6e2b376f9328a73f4df2555a9f96970553b2fa4bb17cc04192c64b24a86c166aa69392100586b0ebd8c6715839bc8a3576b549b13d3157f615ddba > '' > } > > The trace is below: > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/request_forgery_protection.rb:79:in > `verify_authenticity_token'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:469:in `send!'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:469:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:441:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:716:in `run_before_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:695:in `call_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:689:in `perform_action_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/rescue.rb:199:in `perform_action_without_caching'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/caching.rb:678:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/ > active_record/ > connection_adapters/abstract/query_cache.rb:33:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/ > active_record/ > query_cache.rb:8:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/caching.rb:677:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:524:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:524:in `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:685:in > `process_without_session_management_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/session_management.rb:123:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:388:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:171:in `handle_request'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:115:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:126:in `dispatch_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:9:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 112:in `handle_dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 78:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 62:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ > webrick.rb:66 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: > 39 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > script/server:3 > > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/request_forgery_protection.rb:79:in > `verify_authenticity_token'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:469:in `send!'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:469:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:441:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:716:in `run_before_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:695:in `call_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:689:in `perform_action_without_benchmark'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/benchmarking.rb:68:in > `perform_action_without_rescue'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/rescue.rb:199:in `perform_action_without_caching'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/caching.rb:678:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/ > active_record/ > connection_adapters/abstract/query_cache.rb:33:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/activerecord-2.0.2/lib/ > active_record/ > query_cache.rb:8:in `cache'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/caching.rb:677:in `perform_action'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:524:in `send'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:524:in `process_without_filters'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/filters.rb:685:in > `process_without_session_management_support'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/session_management.rb:123:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/base.rb:388:in `process'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:171:in `handle_request'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:115:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:126:in `dispatch_cgi'' > /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.0.2/lib/ > action_controller/dispatcher.rb:9:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 112:in `handle_dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 78:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'' > /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'' > /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'' > /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/webrick_server.rb: > 62:in `dispatch'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/servers/ > webrick.rb:66 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:342:in `new_constants_in'' > /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ > active_support/dependencies.rb:496:in `require'' > /usr/local/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/server.rb: > 39 > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require'' > /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require'' > script/server:3 > > Request > > Parameters: > > {"commit"=>"Create story", > "story"=>{"name"=>"Digg", > "updated_at(1i)"=>"2008", > "created_at(1i)"=>"2008", > "updated_at(2i)"=>"1", > "created_at(2i)"=>"1", > "updated_at(3i)"=>"6", > "created_at(3i)"=>"6", > "updated_at(4i)"=>"01", > "created_at(4i)"=>"01", > "updated_at(5i)"=>"55", > "created_at(5i)"=>"55", > "link"=>"www.digg.com"}} > > Show session dump > > --- > :csrf_id: 7cc001388388e0df08f578db3c990f89 > flash: !map:ActionController::Flash::FlashHash {} > > Response > > Headers: > > {"cookie"=>[], > "Cache-Control"=>"no-cache"} > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
hi, since i use protect_from_forgery in my code i got sometime some "ActionController::InvalidAuthenticityToken" exception. In rescue_action_in_public in application.rb, i handle this exception with a redirect but it can be annoying for a user validating a form. The point is i like to know what does raise this exception? and is there a better way to handle them? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I am new to RoR. I am running Linux Red Hat Enterprise with MySQL for my db, and when I go and either create/update the database I get this message: ActionController::InvalidAuthenticityToken in Test1Controller#create(or update) ActionController::InvalidAuthenticityToken I can destroy any of the items in the db, just can not create or update. The answer is probably simple, but I just have not found it yet...if more information is needed please let me know. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Michael, This article will explain what this error message is about. http://ryandaigle.com/articles/2007/9/24/what-s-new-in-edge-rails-better-cross-site-request-forging-prevention Hope this helps, Scott Michael Jubin wrote:> I am new to RoR. I am running Linux Red Hat Enterprise with MySQL for > my db, and when I go and either create/update the database I get this > message: > > ActionController::InvalidAuthenticityToken in Test1Controller#create(or > update) > ActionController::InvalidAuthenticityToken-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Michael Jubin wrote:> I am new to RoR. I am running Linux Red Hat Enterprise with MySQL for > my db, and when I go and either create/update the database I get this > message: > > ActionController::InvalidAuthenticityToken in Test1Controller#create(or > update) > ActionController::InvalidAuthenticityToken > > I can destroy any of the items in the db, just can not create or update. > The answer is probably simple, but I just have not found it yet...if > more information is needed please let me know.I added the lines :only => [:update, :delete, :create] after protect_from_forgery and things worked. I''m on rails 2.3+ -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.