Skip to content

Instantly share code, notes, and snippets.

@almaron
Created June 9, 2012 07:41
Show Gist options
  • Select an option

  • Save almaron/2900011 to your computer and use it in GitHub Desktop.

Select an option

Save almaron/2900011 to your computer and use it in GitHub Desktop.
#The Error
ActionView::Template::Error (Infinity):
<div class="forum_right_links">
<% chars = (@topic.forum.tech == 1) ? :owned_real : :active %>
<%= link_to t("forum.links.moderate"), "", :remote => false if user_permitted? :moderate %>
</div>
<%= will_paginate(@posts) %>
<div class="posts_wrap">
<% @posts.each do |post| %>
#The controller action
def show
topic_id = params[:id] || params[:topic_id]
@topic = Forum::Topic.find(topic_id)
per_page = @pageconfigs[:forum_page_limit].to_i || 15
@posts = @topic.posts.paginate(:page => params[:page], :per_page => per_page)
@chars = @topic.forum.tech == 1 ? user_get_chars(:real) : user_get_chars(:active)
@new_post = Forum::Post.new if @chars.any?
@meta[:title] = "#{@topic.head} - #{t("forum.head.index")}"
end
end
#user_permitted? Method
def user_permitted? (privilege)
current_user && current_user.has_privilege?(privilege)
end
helper_method :user_permitted?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment