def set_site_id
u = User.find_by_user_name params[:user_name]
params[:site_id] = u ? u.site_id : nil
return true
end
Then in your actions,
def some_action @site = Site.find(params[:site_id])
end
Hope this helps…
Also, if you’re only going to use this route in a specific controller,
put the before_filter and accompanying action in it, instead of in the
application_controller, where it will be run before every request, not
just those run on the desired controller.