Class: Virgo::PageModulesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/virgo/page_modules_controller.rb

Instance Method Summary collapse

Methods included from RenderHelper

#render_content, #with_format

Methods included from ApplicationHelper

#action?, #admin?, #admin_access?, #admin_view?, #alerts, #base_errors, #category_timestamp, #column_timestamp, #compact_html, #controller?, #decode_html_entities, #expanded_post_url, #is_admin_view?, #page_url, #post_time_format, #post_timestamp, #production?, #redis_timestamp_key_for, #site, #site_key, #superuser?, #tabbed_param, #word_count

Instance Method Details



7
8
9
10
11
12
13
14
15
# File 'app/controllers/virgo/page_modules_controller.rb', line 7

def popular_posts
  @category = Category.friendly.find(params[:category_id]) if params[:category_id].present?
  @tabbed = @category.present? ? true : false
  @tab = @category.present? ? :category : :all

  render json: {
    html: render_content(partial: '/virgo/page_modules/popular_posts', locals: {category: @category, tab: @tab, tabbed: @tabbed})
  }
end