Class: PostsController
- Inherits:
-
Spree::BaseController
- Object
- Spree::BaseController
- PostsController
- Defined in:
- app/controllers/posts_controller.rb
Instance Method Summary collapse
Instance Method Details
#index ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/posts_controller.rb', line 4 def index @tag = params[:tag] @year = params[:year] @month = params[:month] @day = params[:day] @posts = @year ? Post.by_date(@year.to_i, @month.try(:to_i), @day.try(:to_i)) : Post @posts = @posts.published @posts = @posts.tagged_with(@tag) if @tag respond_to do |format| format.html { @posts = @posts.paginate(:page => params[:page], :per_page => 10) } format.rss end end |
#show ⇒ Object
20 21 22 |
# File 'app/controllers/posts_controller.rb', line 20 def show @post = Post.published.find_by_permalink(params[:id]) end |