Class: PageTemplatesController

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

Instance Method Summary (collapse)

Methods inherited from ApplicationController

#is_current_user?

Instance Method Details

- (Object) create



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

def create
  @page_template = PageTemplate.new(params[:page_template])
  if @page_template.save
    redirect_to page_templates_path, :notice => t(:page_template_successfully_created)
  else
    render :new
  end
end

- (Object) destroy



38
39
40
41
42
43
44
# File 'app/controllers/page_templates_controller.rb', line 38

def destroy
  if @page_template.delete
    redirect_to(page_templates_path, :notice => t(:page_template_successfully_destroyed))
  else
    redirect_to(page_templates_path, :alert => @page_template.errors[:base].first.to_s)
  end
end

- (Object) edit



27
28
# File 'app/controllers/page_templates_controller.rb', line 27

def edit
end

- (Object) index



7
8
# File 'app/controllers/page_templates_controller.rb', line 7

def index
end

- (Object) new



15
16
# File 'app/controllers/page_templates_controller.rb', line 15

def new
end

- (Object) show

Show all postings for this blog



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

def show
end

- (Object) update



30
31
32
33
34
35
36
# File 'app/controllers/page_templates_controller.rb', line 30

def update
  if @page_template.update_attributes(params[:page_template])
    redirect_to(page_templates_path, :notice => t(:page_template_successfully_updated))
  else
    render :edit
  end
end