Class: Fe::Admin::EmailTemplatesController

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

Instance Method Summary collapse

Instance Method Details

#createObject



29
30
31
32
33
34
35
36
37
38
39
# File 'app/controllers/fe/admin/email_templates_controller.rb', line 29

def create
  @email_template = Fe::EmailTemplate.new(email_template_params)
  
  respond_to do |format|
    if @email_template.save
      format.html { redirect_to fe_admin_email_templates_path }
    else
      format.html { render action: :new }
    end
  end
end

#destroyObject



53
54
55
56
57
58
59
60
# File 'app/controllers/fe/admin/email_templates_controller.rb', line 53

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

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

#editObject



21
22
23
24
25
26
27
# File 'app/controllers/fe/admin/email_templates_controller.rb', line 21

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

#indexObject



5
6
7
8
9
10
11
# File 'app/controllers/fe/admin/email_templates_controller.rb', line 5

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

  respond_to do |format|
    format.html
  end
end

#newObject



13
14
15
16
17
18
19
# File 'app/controllers/fe/admin/email_templates_controller.rb', line 13

def new 
  @email_template = Fe::EmailTemplate.new

  respond_to do |format|
    format.html
  end
end

#updateObject



41
42
43
44
45
46
47
48
49
50
51
# File 'app/controllers/fe/admin/email_templates_controller.rb', line 41

def update 
  @email_template = Fe::EmailTemplate.find(params[:id])
  
  respond_to do |format|
    if @email_template.update(email_template_params)
      format.html { redirect_to fe_admin_email_templates_path }
    else
      format.html { render action: "edit" }
    end
  end
end