Module: Pageflow::ThemesHelper

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

Constant Summary

Constants included from RenderJsonHelper

RenderJsonHelper::ESCAPED_CHARS, RenderJsonHelper::ESCAPED_CHARS_REGEX

Instance Method Summary collapse

Methods included from RenderJsonHelper

#render_html_partial, #render_json, #render_json_partial, #render_json_seed, #sanitize_json

Instance Method Details

#theme_json_seeds(config) ⇒ Object



11
12
13
14
15
# File 'app/helpers/pageflow/themes_helper.rb', line 11

def theme_json_seeds(config)
  render_json_partial('pageflow/themes/theme',
                      collection: config.themes.to_a,
                      as: :theme)
end

#themes_options_json_seed(config = Pageflow.config) ⇒ Object



5
6
7
8
9
# File 'app/helpers/pageflow/themes_helper.rb', line 5

def themes_options_json_seed(config = Pageflow.config)
  config.themes.each_with_object({}) { |theme, options|
    options[theme.name] = theme.options
  }.to_json.html_safe
end