Class: Motor::ResourcesController

Inherits:
ApiBaseController show all
Defined in:
app/controllers/motor/resources_controller.rb

Instance Method Summary collapse

Methods included from CurrentAbility

#current_ability

Methods included from CurrentUserMethod

#current_user

Instance Method Details

#createObject


13
14
15
16
17
18
# File 'app/controllers/motor/resources_controller.rb', line 13

def create
  Motor::Resources::PersistConfigs.call(@resource)
  Motor::Configs::WriteToFile.call

  render json: { data: Motor::ApiQuery::BuildJson.call(@resource, params, current_ability) }
end

#indexObject


9
10
11
# File 'app/controllers/motor/resources_controller.rb', line 9

def index
  render json: { data: Motor::ApiQuery::BuildJson.call(@resources, params, current_ability) }
end