Module: Ronin::App::Helpers::HTML
- Defined in:
- lib/ronin/app/helpers/html.rb
Overview
HTML helper methods.
Instance Method Summary collapse
-
#h(text) ⇒ String
Escapes the text as HTML text.
-
#hattr(text) ⇒ String
Escapes the text as an HTML attribute value.
-
#partial(name, **locals) ⇒ Object
Renders a partial template.
Instance Method Details
#h(text) ⇒ String
Escapes the text as HTML text.
52 53 54 |
# File 'lib/ronin/app/helpers/html.rb', line 52 def h(text) Rack::Utils.escape_html(text.to_s) if text end |
#hattr(text) ⇒ String
Escapes the text as an HTML attribute value.
65 66 67 |
# File 'lib/ronin/app/helpers/html.rb', line 65 def hattr(text) Rack::Utils.escape_path(text.to_s) if text end |
#partial(name, **locals) ⇒ Object
Renders a partial template.
39 40 41 |
# File 'lib/ronin/app/helpers/html.rb', line 39 def partial(name,**locals) erb(:"_#{name}", layout: nil, locals: locals) end |