I'm new to Ruby and Rails and that's why I'm working my way through
RailsSpace. Unfortunately, I'm trying to use Rails 2.1.0 and ruby
1.8.6 (2007-09-24 patchlevel 111) [i486-linux]
When I get to Chapter 6 and start working in sessions, the
registration form page breaks. I get this error message:
ActionController::InvalidAuthenticityToken in User#register
Showing user/register.html.erb where line #2 raised:
No :secret given to the #protect_from_forgery call. Set that or use a
session store capable of generating its own keys (Cookie Session
Store).
Extracted source (around line #2):
1: <h2>Register</h2>
2: <% form_for :user do |form| %>
3: <fieldset>
4: <legend>Enter your details</legend>
5:
RAILS_ROOT: /home/www/ruby/rails_space
Application Trace | Framework Trace | Full Trace
/usr/lib/ruby/gems/1.8/gems/actionpack-2.1.0/lib/action_controller/
request_forgery_protection.rb:115:in `form_authenticity_token'
(eval):2:in `send'
(eval):2:in `form_authenticity_token'
app/views/user/register.html.erb:2:in
`_run_erb_47app47views47user47register46html46erb'
[snip]
I have tried the errata suggestion: comment out the line with
the :secret key in app/controllers/application.rb.
That change has no effect.
The rake command does not reveal any errors with the test built so
far.