Class: Spree::Admin::ThemesTemplatesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/admin/themes_templates_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/spree/admin/themes_templates_controller.rb', line 15

def create
  @template = @theme.themes_templates.build(new_template_params)
  @template.created_by_admin = true

  if @template.save
    redirect_to admin_theme_templates_path(@theme)
  else
    render :new
  end
end

#editObject



26
27
# File 'app/controllers/spree/admin/themes_templates_controller.rb', line 26

def edit
end

#indexObject



8
9
# File 'app/controllers/spree/admin/themes_templates_controller.rb', line 8

def index
end

#newObject



11
12
13
# File 'app/controllers/spree/admin/themes_templates_controller.rb', line 11

def new
  @template = @theme.themes_templates.build
end

#updateObject



29
30
31
32
# File 'app/controllers/spree/admin/themes_templates_controller.rb', line 29

def update
  @template.update(template_params)
  render :edit
end