Class: EveApp::SimpleResourceController

Inherits:
ApplicationController show all
Defined in:
app/controllers/eve_app/simple_resource_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject

before_action :authenticate_token!

[View source]

10
11
12
13
14
15
16
17
18
# File 'app/controllers/eve_app/simple_resource_controller.rb', line 10

def index
  if params[:filter] && params[:filter][:id]
    render json: scope.where(id: params[:filter][:id].split(',')), include: serializer_include
  elsif self.allow_index
    render json: scope, include: self.serializer_include
  else
    render :bad_request
  end
end

#showObject

[View source]

20
21
22
# File 'app/controllers/eve_app/simple_resource_controller.rb', line 20

def show
  render json: scope.find(params[:id]) #, include: self.serializer_include
end