Class: MailEngine::MailTemplateFilesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/mail_engine/mail_template_files_controller.rb

Constant Summary

Constants included from MailEngine

PLACEHOLDERS_IN_LAYOUT, VERSION

Instance Method Summary collapse

Methods inherited from ApplicationController

#close_modal_and_refresh

Instance Method Details

#createObject



18
19
20
21
22
23
24
25
# File 'app/controllers/mail_engine/mail_template_files_controller.rb', line 18

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

#destroyObject



35
36
37
38
# File 'app/controllers/mail_engine/mail_template_files_controller.rb', line 35

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

#editObject



8
9
# File 'app/controllers/mail_engine/mail_template_files_controller.rb', line 8

def edit
end

#indexObject



5
6
# File 'app/controllers/mail_engine/mail_template_files_controller.rb', line 5

def index
end

#newObject



14
15
16
# File 'app/controllers/mail_engine/mail_template_files_controller.rb', line 14

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

#showObject



11
12
# File 'app/controllers/mail_engine/mail_template_files_controller.rb', line 11

def show
end

#updateObject



27
28
29
30
31
32
33
# File 'app/controllers/mail_engine/mail_template_files_controller.rb', line 27

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