Sha256: 754bd6eea84731ea41a145e3afa98c442057c0c1083d2e9df04e81b0a0477f48

Contents?: true

Size: 1001 Bytes

Versions: 9

Compression:

Stored size: 1001 Bytes

Contents

class MailEngine::MailTemplateFilesController < MailEngine::ApplicationController
  layout "mail_engine/simple"
  before_filter :find_model

  def index
  end

  def new
    @mail_template_file = @mail_template.mail_template_files.new
  end

  def create
    @mail_template_file = @mail_template.mail_template_files.build(params[:mail_engine_mail_template_file])
    if @mail_template_file.save
      close_modal_and_refresh
    else
      render :new
    end
  end

  def edit
  end

  def update
    if @mail_template_file.update_attributes(params[:mail_engine_mail_template_file])
      close_modal_and_refresh
    else
      render :edit
    end
  end

  def destroy
    @mail_template_file.destroy
    render :text => "window.location.reload()"
  end

  def show
  end

  private

  def find_model
    @mail_template = MailTemplate.find(params[:mail_template_id]) if params[:mail_template_id].present?
    @mail_template_file = MailTemplateFile.find(params[:id]) if params[:id].present?
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
mail_engine-0.1.8 app/controllers/mail_engine/mail_template_files_controller.rb
mail_engine-0.1.7 app/controllers/mail_engine/mail_template_files_controller.rb
mail_engine-0.1.6 app/controllers/mail_engine/mail_template_files_controller.rb
mail_engine-0.1.5 app/controllers/mail_engine/mail_template_files_controller.rb
mail_engine-0.1.4 app/controllers/mail_engine/mail_template_files_controller.rb
mail_engine-0.1.3 app/controllers/mail_engine/mail_template_files_controller.rb
mail_engine-0.1.2 app/controllers/mail_engine/mail_template_files_controller.rb
mail_engine-0.1.1 app/controllers/mail_engine/mail_template_files_controller.rb
mail_engine-0.1.0 app/controllers/mail_engine/mail_template_files_controller.rb