API v1 article_categories endpoint
This commit is contained in:
parent
e1d50e5b9c
commit
69732cca0d
6 changed files with 117 additions and 0 deletions
26
app/controllers/api/v1/article_categories_controller.rb
Normal file
26
app/controllers/api/v1/article_categories_controller.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
class Api::V1::ArticleCategoriesController < Api::V1::BaseController
|
||||
include Concerns::CollectionScope
|
||||
|
||||
def index
|
||||
render json: search_scope
|
||||
end
|
||||
|
||||
def show
|
||||
render json: scope.find(params.require(:id))
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def max_per_page
|
||||
nil
|
||||
end
|
||||
|
||||
def default_per_page
|
||||
nil
|
||||
end
|
||||
|
||||
def scope
|
||||
ArticleCategory.all
|
||||
end
|
||||
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue