Method: Alchemy::Admin::BaseHelper#link_to_dialog
- Defined in:
- app/helpers/alchemy/admin/base_helper.rb
#link_to_dialog(content, url, options = {}, html_options = {}) ⇒ Object
This helper renders the link to an dialog.
We use this for our fancy modal dialogs in the Alchemy cockpit.
Example
<%= link_to_dialog('Edit', edit_product_path, {size: '200x300'}, {class: 'icon_button'}) %>
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'app/helpers/alchemy/admin/base_helper.rb', line 52 def link_to_dialog(content, url, = {}, = {}) = {modal: true} = .merge() if [:title] tooltip = .delete(:title) end anchor = link_to(content, url, .merge( "data-dialog-options" => .to_json, :is => "alchemy-dialog-link" )) if tooltip content_tag("sl-tooltip", anchor, content: tooltip) else anchor end end |