gluttonberg/lib/gluttonberg/helpers/content.rb
# Finds the matching content block and determines the helper it needs
# to execute to actually write the contents to page.
# TODO: if there is no way to to render the content, freak out and raise
# an error
Finds the matching content block and determines the helper it needs
to execute to actually write the contents to page.
TODO: if there is no way to to render the content, freak out and raise
an error
Finds the matching content block and determines the helper it needs to execute to actually write the contents to page . TODO : if there is no way to to render the content freak out and raise an error
def render_content_for(section_name, opts = {})
        content = content_for(section_name)
        render_method = :"render_#{content.content_type}"
        if respond_to? render_method
          send(:"render_#{content.content_type}", content, opts)
        elsif content.respond_to? :text
          content.text
        else
        end
      end
def render_content_for ( section_name , opts = { } ) content = content_for ( section_name ) render_method = :" render_ #{ content . content_type } " if respond_to? render_method send ( :" render_ #{ content . content_type } " , content , opts ) elsif content . respond_to? :text content . text else end end
Finds the matching content block and determines the helper it needs
to execute to actually write the contents to page.
Finds the matching content block and determines the helper it needs to execute to actually write the contents to page .
# At present this generates a bunch of queries. Eventually we should  # look at caching section names to save some DB hits. # raise Gluttonberg::ContentRenderError, "Don't know how to render this content"
section_name
opts