I think Alpha Blue's already pointed out the problem, but I'd reiterate again that trying to follow RailsSpace on a modern Rails stack is not a good idea - too much has changed. Try to at least find a book written for Rails 2...
--Matt Jones On Sep 7, 5:40 pm, RubyonRails_newbie <[email protected]> wrote: > Hi There, > > I am setting a session, whilst following the rails-space tutorial. > > When i hit register, I can see there is a new row inserted to the > sessions table, but now - for some reason, I don't get the flash > message as before: > > My user controller looks like this: > > def register > �...@title = "Register" > if request.post? and params[:user] > �...@user = User.new(params[:user]) > if @user.save > session[:user_id] = @user.id > flash[:notice] = "User '[email protected]_name}' created!" > redirect_to :action => "index", :controller => "user" > end > > My application.rhtml page now has ' <%= debug(session) %> ' added to > the page to view the session on the web page > > I've added > ''config.action_controller.session_store= :active_record_store'' to > the environment.rb page. > > After a quick google earlier, I kept getting an invalid token error, > so i read that adding ''protect_from_forgery :only => > [:create, :update, :destroy] '' to the user controller page resolves > it. Which it did. I no longer get that error. > > However - I have added the code as the book suggests. The user is > still successfully added to the site, and visible in the database, but > the flash message does not get displayed. > > (if i delete this code, I can see the flash message again) > > Any ideas?? > > Many Thanks! --~--~---------~--~----~------------~-------~--~----~ 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 [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

