diff --git a/app/controllers/super_admin/madmp_schemas_controller.rb b/app/controllers/super_admin/madmp_schemas_controller.rb index 2973c4f..a531975 100644 --- a/app/controllers/super_admin/madmp_schemas_controller.rb +++ b/app/controllers/super_admin/madmp_schemas_controller.rb @@ -19,25 +19,24 @@ authorize(MadmpSchema) @schema = MadmpSchema.new(permitted_params) if @schema.save - flash.now[:notice] = success_message(@schema, _("created")) + flash.now[:notice] = success_message(@schema, _('created')) render :edit else - flash.now[:alert] = failure_message(@schema, _("create")) + flash.now[:alert] = failure_message(@schema, _('create')) render :new end end - + def edit authorize(MadmpSchema) end - def update authorize(MadmpSchema) if @schema.update_attributes(permitted_params) - flash.now[:notice] = success_message(@schema, _("updated")) + flash.now[:notice] = success_message(@schema, _('updated')) else - flash.now[:alert] = failure_message(@schema, _("update")) + flash.now[:alert] = failure_message(@schema, _('update')) end render :edit end @@ -45,15 +44,14 @@ def destroy authorize(MadmpSchema) if @schema.destroy - msg = success_message(@schema, _("deleted")) + msg = success_message(@schema, _('deleted')) redirect_to super_admin_madmp_schemas_path, notice: msg else - flash.now[:alert] = failure_message(@schema, _("delete")) + flash.now[:alert] = failure_message(@schema, _('delete')) redner :edit end end - # Private instance methods private @@ -62,7 +60,7 @@ @schema = MadmpSchema.find(params[:id]) end - # Substitute "template_name" key/values for their "schema_id" equivalent in the JSON + # Substitute 'template_name' key/values for their 'schema_id' equivalent in the JSON def substitute_names # Get the actual JSON schema from the params json_data = permitted_params[:schema] @@ -82,6 +80,5 @@ def permitted_params params.require(:madmp_schema).permit(:label, :name, :version, :classname, :schema) end - end -end \ No newline at end of file +end