Class: Jabe::Admin::EntriesController
Instance Method Summary
collapse
#body_class_name, included
included, #public_entry_url
Instance Method Details
#create ⇒ Object
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
|
#destroy ⇒ Object
27
28
29
30
|
# File 'app/controllers/jabe/admin/entries_controller.rb', line 27
def destroy
entry.destroy
redirect_to admin_entries_path
end
|
#index ⇒ Object
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
|
#update ⇒ Object
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
|