Hi All
I can’t for the life of me see what is wrong with this. Maybe it’s cause
it’s midnight…
I want to put some data in a session and I have some code like this:
class ApplicationController < ActionController::Base
model :mything
def ApplicationController.chosen_thing
session[:chosen_thing] ||= MyThing.defaultThing
end
end
So whenever I try to access ApplicationController.mything in one of the
controller subclasses I get the error below.
Any help much appreciated.
Donald
TypeError in MainController#index
Symbol as array index
RAILS_ROOT: /Rails/foo/public/…/config/…
Application Trace | Framework Trace | Full Trace
#{RAILS_ROOT}/app/controllers/application.rb:10:in []' #{RAILS_ROOT}/app/controllers/application.rb:10:in
compute’
#{RAILS_ROOT}/app/controllers/main_controller.rb:4:in `index’
Request
Parameters: None
Show session dump
flash: !map:ActionController::Flash::FlashHash {}
Response
Headers: {“cookie”=>[], “Cache-Control”=>“no-cache”}