I've created a module to include in a Controller. Basically it works, but I am expecting methods in the module to have access to instance variables from the controller, and that appears to not be the case. Yet, a simple Ruby example says it should be. I'm not sure what's different.
@type = 'circle'
@type = 'square'
x = Shape.new
puts x.type # 'square'
puts x.type # 'circle'
My distilled Rails example would be something like this. I require the file in application.rb.
@test_var = 'y'
class UsersAdminController < ApplicationController
@test_var = 'x'
Using debug(@test_var) the value doesn't ever appear to change from 'x'