Module: Pageflow::PageTypesHelper

Includes:
RenderJsonHelper
Defined in:
app/helpers/pageflow/page_types_helper.rb

Instance Method Summary collapse

Methods included from RenderJsonHelper

#render_html_partial, #render_json_partial, #render_json_seed, #render_with_format

Instance Method Details

#page_type_json_seedsObject


5
6
7
# File 'app/helpers/pageflow/page_types_helper.rb', line 5

def page_type_json_seeds
  render_json_partial('pageflow/page_types/page_type', :collection => Pageflow.config.page_types, :as => :page_type)
end

#page_type_templatesObject


9
10
11
12
13
14
15
16
17
# File 'app/helpers/pageflow/page_types_helper.rb', line 9

def page_type_templates
  safe_join(Pageflow.config.page_types.map do |page_type|
    (:script,
                render_to_string(:template => page_type.template_path,
                                 :locals => {:configuration => {}, :page => Page.new},
                                 :layout => false).to_str,
                :type => 'text/html', :data => {:template => "#{page_type.name}_page"})
  end)
end