I'm trying to set a session variable in application_controller.rb, using simply:
@color = "grey"
session[:colors] = @color
When trying to look at my site I get:
undefined method `session' for ApplicationController:Class
I've used this before and from all the docs this is how I'm supposed to do it! The site was working fine until I tried using session. ApplicationController inherits from ActionController and according to the API documentation, the session stuff is in the actionpack gem which is installed on my system and shows up when I run "bundle install" and "bundle show actionpack". I've also tried "gem update".
I'm using Rails 3.1.0, Gem 1.8.13, Ruby 1.9.2, running on Ubuntu 11.10
$bundle show actionpack
/usr/lib/ruby/gems/1.9.1/gems/actionpack-3.1.0I've tried this on two separate sites on the same box, one with Apache2 and one with WEBbrick, even running it as root. The second site is a test site with no changes whatsoever made to startup or initialization files. I've checked access rights, chmodding everything to 775, restarting the whole system etc etc and I can't work out why the blessed thing won't work!
Does anybody have a clue what might be going on?
Telefon: 3020 0868
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 firstname.lastname@example.org.
To unsubscribe from this group, send email to email@example.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.