Class: Jabe::Admin::EntriesController

Inherits:
BaseController show all
Defined in:
app/controllers/jabe/admin/entries_controller.rb

Instance Method Summary collapse

Methods included from BodyClassHelper

#body_class_name, included

Methods included from PublicEntryUrl

included, #public_entry_url

Instance Method Details

#createObject



11
12
13
14
15
16
17
# File 'app/controllers/jabe/admin/entries_controller.rb', line 11

def create
  if entry.save
    redirect_to(admin_entries_path, :notice => message)
  else
    render :new
  end
end

#destroyObject



27
28
29
30
# File 'app/controllers/jabe/admin/entries_controller.rb', line 27

def destroy
  entry.destroy
  redirect_to admin_entries_path
end

#indexObject



6
7
8
9
# File 'app/controllers/jabe/admin/entries_controller.rb', line 6

def index
  @drafts  = Entry.drafts
  @published = Entry.published.page(params[:page])
end

#updateObject



19
20
21
22
23
24
25
# File 'app/controllers/jabe/admin/entries_controller.rb', line 19

def update
  if entry.update_attributes(params[:entry])
    redirect_to(admin_entries_path, :notice => message)
  else
    render :edit
  end
end