Module: Iron::UiHelper
- Included in:
- ApplicationHelper
- Defined in:
- app/helpers/iron/ui_helper.rb
Instance Method Summary collapse
- #back_button_to(title, url, options = {}) ⇒ Object
- #badge(content = nil, **options, &block) ⇒ Object
Instance Method Details
#back_button_to(title, url, options = {}) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/helpers/iron/ui_helper.rb', line 3 def (title, url, = {}, &) link_to url, class: tw( "inline-flex items-center gap-2 text-sm/6 text-stone-500 dark:text-stone-400", .delete(:class) ) do safe_join([ icon("chevron-left", class: "size-4"), tag.span(title) ]) end end |
#badge(content = nil, **options, &block) ⇒ Object
16 17 18 19 20 |
# File 'app/helpers/iron/ui_helper.rb', line 16 def badge(content = nil, **, &block) tag.span class: tw("badge", .delete(:class)), ** do block_given? ? capture(&block) : content end end |