Displaying 1 result from an estimated 1 matches for "usersadmincontroller".
Did you mean:
useradmincontroller
2008 May 17
1
Scope Confusion - Controller iVars in Modules
...9;'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''
change_test_var
end
end
Using debug(@test_var) the value doesn''t eve...