Class: Gluttonberg::Admin::Settings::EmbedsController

Inherits:
BaseController show all
Defined in:
app/controllers/gluttonberg/admin/settings/embeds_controller.rb

Overview

this controller manages embed code (shortcodes). wysiwyg snippets which can be embed in other content.

Instance Method Summary collapse

Instance Method Details

#createObject



22
23
24
25
26
27
28
# File 'app/controllers/gluttonberg/admin/settings/embeds_controller.rb', line 22

def create
  @embed = Embed.new(params[:gluttonberg_embed])
  generic_create(@embed, {
    :name => "embed",
    :success_path => admin_embeds_path
  })
end

#deleteObject



41
42
43
44
45
46
47
48
# File 'app/controllers/gluttonberg/admin/settings/embeds_controller.rb', line 41

def delete
  display_delete_confirmation(
    :title      => "Delete Embed '#{@embed.name}'?",
    :url        => admin_embed_path(@embed),
    :return_url => admin_embeds_path,
    :warning    => ""
  )
end

#destroyObject



50
51
52
53
54
55
56
# File 'app/controllers/gluttonberg/admin/settings/embeds_controller.rb', line 50

def destroy
  generic_destroy(@embed, {
    :name => "embed",
    :success_path => admin_embeds_path,
    :failure_path => admin_embeds_path
  })
end

#editObject



30
31
# File 'app/controllers/gluttonberg/admin/settings/embeds_controller.rb', line 30

def edit
end

#indexObject



14
15
16
# File 'app/controllers/gluttonberg/admin/settings/embeds_controller.rb', line 14

def index
  @embeds = Embed.order("created_at ASC")
end

#list_for_redactorObject



58
59
60
61
# File 'app/controllers/gluttonberg/admin/settings/embeds_controller.rb', line 58

def list_for_redactor
  @embeds = Embed.order("created_at ASC")
  render :layout => false
end

#newObject



18
19
20
# File 'app/controllers/gluttonberg/admin/settings/embeds_controller.rb', line 18

def new
  @embed = Embed.new
end

#updateObject



33
34
35
36
37
38
39
# File 'app/controllers/gluttonberg/admin/settings/embeds_controller.rb', line 33

def update
  @embed.assign_attributes(params[:gluttonberg_embed])
  generic_update(@embed, {
    :name => "embed",
    :success_path => admin_embeds_path
  })
end