Class: JournalPostsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- JournalPostsController
- Defined in:
- app/controllers/journal_posts_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/journal_posts_controller.rb', line 4 def index @page = params[:page].try(:to_i) || 1 @perPage = 15 if @page == 1 @featured = JournalPost.not_hidden.published.featured end @posts = JournalPost.not_hidden.published.not_featured.page(@page).per(@perPage) end |
#preview ⇒ Object
20 21 22 23 |
# File 'app/controllers/journal_posts_controller.rb', line 20 def preview @post = post_by_int_id render @post.template_name || "show" end |
#redirect ⇒ Object
25 26 27 28 |
# File 'app/controllers/journal_posts_controller.rb', line 25 def redirect @post = published_post_by_int_id redirect_to show_journal_post_path(@post.hex, @post.slug) end |
#show ⇒ Object
15 16 17 18 |
# File 'app/controllers/journal_posts_controller.rb', line 15 def show @post = published_post_by_int_id render @post.template_name || "show" end |