Is there a place where I can put a method that can be accessed in both
views and controllers?
Here’s the situation, maybe someone can suggest a better way to go about
I created my own custom login system with email verification and user
roles (basically, I tinkered around with SaltedHashLoginGenerator
until I finally gave up and wrote my own). One role, of course, is an
admin role. Users with this designation can add headline articles,
new employee bios, etc.
All methods in a controller may or may not need the admin role so I
cant use a before_filter in all of them. So I created an is_admin
method and put it in the application controller. Works great.
Problem is, there are times when I need to do an is_admin check inside
So where can I place is_admin so both the view and controller can call
it? Is there a better way of doing this?