Sha256: 2e9851343de89cc4fbd9651ebf8f1c8f6f4ee12619adce95dfc53e146579d73b
Contents?: true
Size: 694 Bytes
Versions: 27
Compression:
Stored size: 694 Bytes
Contents
module Enjoy module Controllers module News extend ActiveSupport::Concern def index @news = model.enabled.after_now.by_date unless Enjoy.config.news_per_page.nil? @news = @news.page(params[:page]) end end def show @news = model.after_now.find(params[:id]) if @news and @news.text_slug != params[:id] redirect_to @news, status_code: 301 return true end end private def model Enjoy::News end def page_title if @news.class.name == model.name @news.page_title else super end end end end end
Version data entries
27 entries across 27 versions & 1 rubygems