I have this in my plugins directory:
1: <% if current_user && current_user.admin? %>
2: <div class="blogAdminLinks">
3: <ul class="blogList">
4: <li class="blogListFirst"><%= link_to 'New Blog Post',
As you can see,it references current_user
So I define current_user in User model as a global variable:
I application controller, I define who current user is:
@current_user = User.find(1)
return @current_user if defined?(@current_user)
It does appear that the method overrides the one in model, assuming the
one in model is a getter/setter.
Nevertheless, when I make a reference to it in one of my views, I get
undefined error method. Any idea?
Thanks for response.