Sha256: 33ab3a35cdabd2a9375248d6fc53249fd16b47a913d3e8170aa45c55ab9cc0a7
Contents?: true
Size: 969 Bytes
Versions: 39
Compression:
Stored size: 969 Bytes
Contents
module Ecom module Core class ApplicationModulesController < ApplicationController def index render json: ApplicationModule.all end 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 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 private def application_module_params params.require(:application_module).permit(:code, :name) end end end end
Version data entries
39 entries across 39 versions & 1 rubygems