Class: ArticlesController
- Inherits:
-
Spree::BaseController
- Object
- Spree::BaseController
- ArticlesController
- Defined in:
- app/controllers/articles_controller.rb
Instance Method Summary collapse
Instance Method Details
#archive ⇒ Object
15 16 17 18 |
# File 'app/controllers/articles_controller.rb', line 15 def archive @articles = Article.find_articles(:year => params[:year], :month => params[:month]) render :action => 'index' end |
#index ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'app/controllers/articles_controller.rb', line 4 def index @per_page = 10 @current_page = (params[:page] || 1).to_i @total_pages = (Article.count / @per_page.to_f).ceil @articles = Article.find_articles(:page => @current_page) respond_to do |wants| wants.html {} wants.xml {} end end |