I’m trying to write a module to be used as a mix-in, my first attempt at
such. This sample code outlines the basics of what I’ve done so far…
Filters added to this controller apply to all controllers in the
Likewise, all the methods added will be available for all controllers.
class ApplicationController < ActionController::Base
Given these three files, I can use “foo_var” without error in any of my
controllers. However, when I try to use “foo_var” in a view, I get a “no
method” error. I know it’s possible to make “foo_var” available
everywhere - example, the login engine had “current_user” and “user?”
methods that could be accessed in any controller or view.
I’m sort of shooting in the dim light, not quite the dark, after reading
some articles and sample code. Any help appreciated.