Module: PagesCore::Admin::NewsPageController

Extended by:
ActiveSupport::Concern
Included in:
Admin::PagesController
Defined in:
app/controllers/concerns/pages_core/admin/news_page_controller.rb

Instance Method Summary collapse

Instance Method Details

#new_newsObject



26
27
28
29
# File 'app/controllers/concerns/pages_core/admin/news_page_controller.rb', line 26

def new_news
  new
  render action: :new
end

#newsObject



14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/concerns/pages_core/admin/news_page_controller.rb', line 14

def news
  @archive_finder = archive_finder(@news_pages, @locale)
  unless @year
    redirect_to(news_admin_pages_path(@locale,
                                      (@archive_finder.latest_year ||
                                       Time.zone.now.year)))
    return
  end
  @pages = @archive_finder.by_year_and_maybe_month(@year, @month)
                          .paginate(per_page: 50, page: params[:page])
end