In my controller for the index action, I have;
def index
@documents = current_user.documents.all if current_user
end
Anything I add on the end of current_user I get an error. For example, I tried to add will_paginate which is simply adding .paginate(:per_page => 5, :page => params[:page]) to the end of the index action and adding <%= will_paginate @documents %> to the views.
Once I add the .paginate(:per_page => 5, :page => params[:page]) to the end of the index method, like this;
def index
@documents = current_user.documents.all if current_user.paginate(:per_page => 5, :page => params[:page])
end
I get a NoMethodError. Anybody know how to fix this?
Try