Class: Monologue::PostsController
Instance Method Summary
collapse
#all_tags, #not_found, #recent_posts
Instance Method Details
#feed ⇒ Object
20
21
22
|
# File 'app/controllers/monologue/posts_controller.rb', line 20
def feed
@posts = Monologue::Post.published.limit(25)
end
|
#index ⇒ Object
4
5
6
7
|
# File 'app/controllers/monologue/posts_controller.rb', line 4
def index
@page = params[:page].nil? ? 1 : params[:page]
@posts = Monologue::Post.published.page(@page)
end
|
#show ⇒ Object
9
10
11
12
13
14
15
16
17
18
|
# File 'app/controllers/monologue/posts_controller.rb', line 9
def show
if monologue_current_user
@post = Monologue::Post.default.where("url = :url", {url: params[:post_url]}).first
else
@post = Monologue::Post.published.where("url = :url", {url: params[:post_url]}).first
end
if @post.nil?
not_found
end
end
|