Sha256: 313288c8ed0fe247240c797ea6bb7cb2389ca051b80552c6e87a154bae28d494
Contents?: true
Size: 835 Bytes
Versions: 14
Compression:
Stored size: 835 Bytes
Contents
module Cmor module Blog # Example: # # # app/controllers/application_controller.rb # class ApplicationController < ActionController::Base # view_helper Cmor::Blog::ApplicationViewHelper, as: :blog_helper # end # class ApplicationViewHelper < Rao::ViewHelper::Base # Example: # # # app/views/layouts/application.html.haml # = blog_helper(self).render_recent_posts(3) # def render_recent_posts(count) posts = Cmor::Blog::Post.published.for_locale.limit(count).all c.render html: posts.collect { |p| render_post(p.id) }.join("<hr />").html_safe end def render_post(id) post = Cmor::Blog::Post.published.for_locale.where(id: id).first render(post: post) if post.present? end end end end
Version data entries
14 entries across 14 versions & 1 rubygems