Class: Ecrire::PostsController
Instance Method Summary
collapse
#current_user, #signed_in?
Instance Method Details
#index ⇒ Object
12
13
14
15
16
17
18
19
20
|
# File 'lib/ecrire/app/controllers/ecrire/posts_controller.rb', line 12
def index
respond_to do |format|
format.html
format.
format.json do
['Access-Control-Allow-Origin'] = '*'
end
end
end
|
#show ⇒ Object
22
23
24
25
|
# File 'lib/ecrire/app/controllers/ecrire/posts_controller.rb', line 22
def show
redirect_to :root and return if post.nil?
redirect_to :root and return unless post.published?
end
|