Class: Admin::TitlesController
Instance Method Summary
collapse
#posts
#current_user, #signed_in?, #url
Instance Method Details
#create ⇒ Object
11
12
13
14
15
16
17
18
19
|
# File 'lib/ecrire/app/controllers/admin/titles_controller.rb', line 11
def create
@title = Admin::Title.new(title_params) do |title|
title.post = post
end
unless @title.save
render 'errors'
end
end
|
#index ⇒ Object
5
6
7
8
9
|
# File 'lib/ecrire/app/controllers/admin/titles_controller.rb', line 5
def index
if post.draft?
render 'edit' and return
end
end
|
#update ⇒ Object
21
22
23
24
25
26
|
# File 'lib/ecrire/app/controllers/admin/titles_controller.rb', line 21
def update
@title = Admin::Title.find(params[:id])
unless @title.update(title_params)
render 'errors'
end
end
|