Sha256: ea3f9113a668de2c23c03a54701ef142a173425672d92a27c00d98753a5473b5

Contents?: true

Size: 417 Bytes

Versions: 4

Compression:

Stored size: 417 Bytes

Contents

module Cmor
  module Blog
    class ApplicationViewHelper < Rao::ViewHelper::Base
      def render_recent_posts(count)
        posts = Cmor::Blog::Post.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.where(id: id).first
        render(post: post) if post.present?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cmor_blog-0.0.44.pre app/view_helpers/cmor/blog/application_view_helper.rb
cmor_blog-0.0.43.pre app/view_helpers/cmor/blog/application_view_helper.rb
cmor_blog-0.0.42.pre app/view_helpers/cmor/blog/application_view_helper.rb
cmor_blog-0.0.41.pre app/view_helpers/cmor/blog/application_view_helper.rb