Module: Pageflow::ThemesHelper

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

Overview

rubocop:todo Style/Documentation

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



9
10
11
12
13
# File 'app/helpers/pageflow/themes_helper.rb', line 9

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
# File 'app/helpers/pageflow/themes_helper.rb', line 5

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