Sha256: faf8aab972dbb0e668b2ca4f28e946c2aa28ec8abb80e1abeb4e3cf2eb44fdb2
Contents?: true
Size: 1.27 KB
Versions: 2
Compression:
Stored size: 1.27 KB
Contents
class Backend::EmailTemplatesController < BackendController include Concerns::Backend::TranslatableController include Concerns::Backend::PositionableController before_action :find_model, only: [:edit, :update] before_action -> { breadcrumb.add t('b.email_templates'), backend_email_templates_path } def index @email_templates = EmailTemplate.all end def new @model = EmailTemplate.new end def create @model = EmailTemplate.new allowed_params if @model.save redirect_to edit_translation_backend_email_template_path(@model, translation_locale: default_locale), notice: translate_notice(:added, :email_template) else render :new end end def update if @model.update_attributes(allowed_params) redirect_to edit_backend_email_template_path(@model), notice: translate_notice(:edited, :email_template) else render :edit end end private def find_model @model = EmailTemplate.find params[:id] end def translation_form Backend::EmailTemplateTranslationForm.new( email_template: @model, translation: @model.translation(params[:translation_locale]) ) end def allowed_params params.require('email_template').permit(:identifier, :description, :from_name, :from_email) end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
udongo-2.0.0 | app/controllers/backend/email_templates_controller.rb |
udongo-1.0.4 | app/controllers/backend/email_templates_controller.rb |