Class: Admin::EmailTemplatesController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/qe/admin/email_templates_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



31
32
33
34
35
36
37
38
39
40
41
42
# File 'app/controllers/qe/admin/email_templates_controller.rb', line 31

def create
  # TODO mass-assignment engineering
  @email_template = EmailTemplate.new(params[:email_template], :without_protection => true)
  
  respond_to do |format|
    if @email_template.save
      format.html { redirect_to admin_email_templates_path }
    else
      format.html { render :action => :new }
    end
  end
end

#destroyObject



57
58
59
60
61
62
63
64
# File 'app/controllers/qe/admin/email_templates_controller.rb', line 57

def destroy
  @email_template = EmailTemplate.find(params[:id])
  @email_template.destroy

  respond_to do |format|
    format.html { redirect_to admin_email_templates_path }
  end
end

#editObject



23
24
25
26
27
28
29
# File 'app/controllers/qe/admin/email_templates_controller.rb', line 23

def edit
  @email_template = EmailTemplate.find(params[:id])
  
  respond_to do |format|
    format.html
  end
end

#indexObject



7
8
9
10
11
12
13
# File 'app/controllers/qe/admin/email_templates_controller.rb', line 7

def index 
  @email_templates = EmailTemplate.order('name')

  respond_to do |format|
    format.html
  end
end

#newObject



15
16
17
18
19
20
21
# File 'app/controllers/qe/admin/email_templates_controller.rb', line 15

def new 
  @email_template = EmailTemplate.new

  respond_to do |format|
    format.html
  end
end

#updateObject



44
45
46
47
48
49
50
51
52
53
54
55
# File 'app/controllers/qe/admin/email_templates_controller.rb', line 44

def update 
  # TODO mass-assignment engineering
  @email_template = EmailTemplate.find(params[:id])
  
  respond_to do |format|
    if @email_template.update_attributes(params[:email_template], :without_protection => true)
      format.html { redirect_to admin_email_templates_path }
    else
      format.html { render :action => "edit" }
    end
  end
end