Sha256: 585065bf6f095c11059cc16f541c95f87d3ee555bcdf2f0025bb6176bef3ac8b
Contents?: true
Size: 968 Bytes
Versions: 34
Compression:
Stored size: 968 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
34 entries across 34 versions & 1 rubygems