Class: Ecom::Core::ApplicationModulesController
Instance Method Summary
collapse
#current_user, #logged_in?
Instance Method Details
#create ⇒ Object
8
9
10
11
12
13
14
15
|
# File 'app/controllers/ecom/core/application_modules_controller.rb', line 8
def create
application_module = ApplicationModule.new(application_module_params)
if application_module.save
render json: application_module, status: :created
else
render json: { success: false, errors: application_module.errors }, status: :unprocessable_entity
end
end
|
#index ⇒ Object
4
5
6
|
# File 'app/controllers/ecom/core/application_modules_controller.rb', line 4
def index
render json: ApplicationModule.all
end
|
#update ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'app/controllers/ecom/core/application_modules_controller.rb', line 17
def update
application_module = ApplicationModule.find(params[:id])
if application_module.update(application_module_params)
render json: application_module
else
render json: { success: false, errors: application_module.errors }, status: :unprocessable_entity
end
end
|