Module: Cloudpress::RendererHelper

Defined in:
app/helpers/cloudpress/renderer_helper.rb

Instance Method Summary collapse

Instance Method Details

#render_cloudpress_archives(archives) ⇒ Object



18
19
20
# File 'app/helpers/cloudpress/renderer_helper.rb', line 18

def render_cloudpress_archives(archives)
  Cloudpress::Renderers::Archives.new(self, archives).render
end

#render_cloudpress_post(post, options = {}, &block) ⇒ Object



8
9
10
11
12
# File 'app/helpers/cloudpress/renderer_helper.rb', line 8

def render_cloudpress_post(post, options={}, &block)
  renderer = Cloudpress::Renderers::Post.new(self, post, options)
  renderer.content = capture(&block) if block_given?
  renderer.render
end

#render_cloudpress_posts(posts, options = {}, &block) ⇒ Object



4
5
6
# File 'app/helpers/cloudpress/renderer_helper.rb', line 4

def render_cloudpress_posts(posts, options={}, &block)
  Cloudpress::Renderers::Posts.new(self, posts, options).render
end

#render_cloudpress_tags(tags) ⇒ Object



14
15
16
# File 'app/helpers/cloudpress/renderer_helper.rb', line 14

def render_cloudpress_tags(tags)
  Cloudpress::Renderers::Tags.new(self, tags).render
end

#render_flash(type, options = {}, &block) ⇒ Object



28
29
30
31
32
# File 'app/helpers/cloudpress/renderer_helper.rb', line 28

def render_flash type, options={}, &block
  renderer = Cloudpress::Renderers::Flash.new(self, type, options)
  renderer.content = capture(&block) if block_given?
  renderer.render
end

#render_flashesObject



22
23
24
25
26
# File 'app/helpers/cloudpress/renderer_helper.rb', line 22

def render_flashes
  (:div, id: 'flashes') do
    flash.map {|k, v| render_flash(k.to_sym) { (:p, v) } }.join("\n").html_safe
  end
end