Module: Katello::LayoutHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/katello/layout_helper.rb
Instance Method Summary collapse
- #javascript(*args, &block) ⇒ Object
- #stylesheet(*args) ⇒ Object
- #trunc_with_tooltip(text, length = 32) ⇒ Object
Instance Method Details
#javascript(*args, &block) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'app/helpers/katello/layout_helper.rb', line 8 def javascript(*args, &block) if block content_for(:inline_javascripts) { block.call } end if args args.map { |arg| content_for(:katello_javascripts) { javascript_include_tag(arg) } } end return "" end |
#stylesheet(*args) ⇒ Object
3 4 5 6 |
# File 'app/helpers/katello/layout_helper.rb', line 3 def stylesheet(*args) args.map { |arg| content_for(:stylesheets) { stylesheet_link_tag(arg) } } return "" end |
#trunc_with_tooltip(text, length = 32) ⇒ Object
18 19 20 21 22 |
# File 'app/helpers/katello/layout_helper.rb', line 18 def trunc_with_tooltip(text, length = 32) text = text.to_s = text.size > length ? { :'data-original-title' => text, :rel => 'twipsy' } : {} content_tag(:span, truncate(text, :length => length), ).html_safe end |