What is proper place for methods/functions?

I have a set of functions that access some app-specific session
variables used for ACL and other sundry items. The dilema is that I need
to access these functions from both controller code and viewer code. Is
there a single place I can put these functions where they will be
accesible to both?

Making them application helpers gets scope to the views but not to the
controllers. At the moment I have them cloned so I can access them in
both places.

What seems crazy is if I just inline the code that accesses the session
variables it works from controllers and views, but I’d rather put the
code in one spot callable by both so I have gotten away from inlining.

I have also tried putting them in a module (/public/lib) but in a module
they seem to only be accesible to controller and/or model code.

Mike K. wrote:

I have a set of functions that access some app-specific session
variables used for ACL and other sundry items. The dilema is that I need
to access these functions from both controller code and viewer code. Is
there a single place I can put these functions where they will be
accesible to both?

You can put these methods in your application controller, and then
specify they are also helper methods:

class ApplicationController < ActionController::Base
helper_method :logged_in?

def logged_in?
session[:user_id].nil? ? false : true
end
end

Very handy and cool. Thanks!