Module: UltraSettings::RenderHelper
- Included in:
- ApplicationView, ConfigurationView
- Defined in:
- lib/ultra_settings/render_helper.rb
Overview
Helper methods for rendering views.
Instance Method Summary collapse
-
#html_escape(value) ⇒ String
HTML escape a value.
-
#render_partial(partial_name, locals = {}) ⇒ String
Render a partial template with the given locals.
Instance Method Details
#html_escape(value) ⇒ String
HTML escape a value.
10 11 12 |
# File 'lib/ultra_settings/render_helper.rb', line 10 def html_escape(value) ERB::Util.html_escape(value) end |
#render_partial(partial_name, locals = {}) ⇒ String
Render a partial template with the given locals.
19 20 21 22 23 24 25 26 |
# File 'lib/ultra_settings/render_helper.rb', line 19 def render_partial(partial_name, locals = {}) template = ViewHelper.erb_template("_#{partial_name}.html.erb") b = binding locals.each do |key, value| b.local_variable_set(key, value) end template.result(b) end |