simple question

Hi i recive the error "undefined method `admin?' for #<ActionView::Base:0x484acd4> "

from this line : forums/index.html.erb

46: <td class="c3"> 47: <%= link_to 'Edit'[:edit_title], edit_forum_path(forum), :class => "tiny", :rel => "directory", :style => "float:right" if admin? %> 48: </td>

the forums controller contains the function :

  def logged_in?

  end

what am i doing wrong ? where does rails look for admin?

oops pasted the wrong method. i have the method

  def admin?     true   end in the forums controller

Ryan Bigg wrote:

As described, Rails is looking for the view to have a method called 'admin?' somewhere (possibly in a helper method) but it does not. If you have an object that you want to share between the controller and the view that has the 'admin?' method on it then you normally do that by defining an instance variable on the controller which is then copied over to the view for you by Rails.

It appears that you're using acts_as_authenticated or restful_authentication. If that's the case then you probably want to use a method on @current_user.

Hey instead of calling as if admin? do it like this... if @controller.admin @controller is the instance variable of current controller which is forum in your case