Module: Virgo::AdminHelper

Defined in:
app/helpers/virgo/admin_helper.rb

Instance Method Summary collapse

Instance Method Details

#pages_action?Boolean

because pages and posts are actually both “Post” records, we need to use a couple hints to establish whether we're on a posts page or a pages page

Returns:

  • (Boolean)

6
7
8
9
# File 'app/helpers/virgo/admin_helper.rb', line 6

def pages_action?
  params[:filters][:post_type] == 'page' ||
    @post && @post.page?
end

#posts_action?Boolean

Returns:

  • (Boolean)

11
12
13
# File 'app/helpers/virgo/admin_helper.rb', line 11

def posts_action?
  (params[:filters][:post_type].blank? || params[:filters][:post_type] == 'post') && (@post.nil? || @post.post?)
end