Class: News::AdministrationController

Inherits:
NewsController show all
Defined in:
app/controllers/news/administration_controller.rb

Overview

This is a top-level class documentation comment for the Administration Controller

POST/PATCH is still handled in NewController

Constant Summary

Constants included from ProjectsHelper

ProjectsHelper::CLASSIFIER, ProjectsHelper::CLASSIFIER_ANNOTATION

Instance Method Summary collapse

Methods inherited from NewsController

#api_index, #api_show, #create, #destroy, #edit, #list, #new, #news_params, #set_news, #types, #update

Methods included from RedirectHelper

#destroy_redirect

Methods included from RequestType

#json_request?

Methods included from LogRecent

#log_user_recent_route

Methods included from Cookies

#digest_cookie, #digested_cookie_exists?

Methods included from Whitelist

#whitelist_constantize

Methods included from ProjectsHelper

#cumulative_gb_per_year, #cumulative_projects_created_per_year, #document_cumulative_gb_per_year, #document_gb_per_year, #gb_per_year, #image_cumulative_gb_per_year, #image_gb_per_year, #invalid_object, #project_classification, #project_initials, #project_link, #project_login_link, #project_matches, #project_tag, #projects_list, #projects_search_form, #sound_cumulative_gb_per_year, #sound_gb_per_year, #taxonworks_classification, #week_in_review_graphs

Methods included from Api::Intercept

#intercept_api

Methods included from TokenAuthentication

#intercept_project, #intercept_user, #intercept_user_or_project, #project_token_authenticate, #token_authenticate

Instance Method Details

#indexObject

GET /news or /news.json



11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/news/administration_controller.rb', line 11

def index
  respond_to do |format|
    format.json {
      @news = News::Administration
        .page(params[:page])
        .per(params[:per])
        .order(:display_start, :created_at)
   
      @news = @news.where(type: params[:type]) if params[:type].present?
    }

  end
  render '/news/index'
end

#showObject



26
27
28
29
# File 'app/controllers/news/administration_controller.rb', line 26

def show
  @news = News::Administration.find(params[:id])
  render '/news/show'
end