Module: Cloudpress::RendererHelper
- Defined in:
- app/helpers/cloudpress/renderer_helper.rb
Instance Method Summary collapse
- #render_cloudpress_archives(archives) ⇒ Object
- #render_cloudpress_post(post, options = {}, &block) ⇒ Object
- #render_cloudpress_posts(posts, options = {}, &block) ⇒ Object
- #render_cloudpress_tags(tags) ⇒ Object
- #render_flash(type, options = {}, &block) ⇒ Object
- #render_flashes ⇒ Object
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, ={}, &block) renderer = Cloudpress::Renderers::Post.new(self, post, ) 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, ={}, &block) Cloudpress::Renderers::Posts.new(self, posts, ).render end |
#render_cloudpress_tags(tags) ⇒ Object
14 15 16 |
# File 'app/helpers/cloudpress/renderer_helper.rb', line 14 def () Cloudpress::Renderers::Tags.new(self, ).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, ={}, &block renderer = Cloudpress::Renderers::Flash.new(self, type, ) renderer.content = capture(&block) if block_given? renderer.render end |
#render_flashes ⇒ Object
22 23 24 25 26 |
# File 'app/helpers/cloudpress/renderer_helper.rb', line 22 def render_flashes content_tag(:div, id: 'flashes') do flash.map {|k, v| render_flash(k.to_sym) { content_tag(:p, v) } }.join("\n").html_safe end end |