Class: RiddlerAdmin::SlugsController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#riddler_current_user, #riddler_user_can_approve?, #riddler_user_can_deploy?

Instance Method Details

#createObject



19
20
21
22
23
24
25
26
27
# File 'app/controllers/riddler_admin/slugs_controller.rb', line 19

def create
  @slug = Slug.new slug_params

  if @slug.save
    redirect_to slugs_url, notice: "Slug was successfully created."
  else
    render :new
  end
end

#destroyObject



40
41
42
43
44
# File 'app/controllers/riddler_admin/slugs_controller.rb', line 40

def destroy
  raise "Destroying slugs is not currently supported"
  @slug.destroy
  redirect_to slugs_url, notice: "Slug was successfully destroyed."
end

#editObject



29
30
# File 'app/controllers/riddler_admin/slugs_controller.rb', line 29

def edit
end

#indexObject



8
9
10
# File 'app/controllers/riddler_admin/slugs_controller.rb', line 8

def index
  @slugs = Slug.all
end

#newObject



15
16
17
# File 'app/controllers/riddler_admin/slugs_controller.rb', line 15

def new
  @slug = Slug.new
end

#showObject



12
13
# File 'app/controllers/riddler_admin/slugs_controller.rb', line 12

def show
end

#updateObject



32
33
34
35
36
37
38
# File 'app/controllers/riddler_admin/slugs_controller.rb', line 32

def update
  if @slug.update slug_params
    redirect_to slugs_url, notice: "Slug was successfully updated."
  else
    render :edit
  end
end