Displaying 1 result from an estimated 1 matches for "change_test_var".
2008 May 17
1
Scope Confusion - Controller iVars in Modules
...''square''
end
end
x = Shape.new
puts x.type # ''square''
x.set_type
puts x.type # ''circle''
My distilled Rails example would be something like this. I require
the file in application.rb.
module EventControls
def change_test_var
@test_var = ''y''
end
end
class UsersAdminController < ApplicationController
include EventControls
layout ''1col_admin''
attr_accessor :test_var
def some_action
@test_var = ''x''...