def modal_trigger(modal_id,
                      text,
                      type: 'a',
                      icon: nil,
                      **options)
      options.merge!(id: "trigger-#{modal_id}")
      options.merge!(:'data-toggle' => 'modal')

      merge_predef_class('btn', options) if type == 'b'

      link_to("##{modal_id}", options) do
        content = ''
        content << glyph_icon(icon) if icon
        content << text
        content.html_safe
      end
    end
def modal_trigger(modal_id,
                      text,
                      type: 'a',
                      icon: nil,
                      **options)
      options.merge!(id: "trigger-#{modal_id}")
      options.merge!(:'data-toggle' => 'modal')

      merge_predef_class('btn', options) if type == 'b'

      link_to("##{modal_id}", options) do
        content = ''
        content << glyph_icon(icon) if icon
        content << text
        content.html_safe
      end
    end
Public: Show a link which can toggle the modal.

 modal_id - String. HTML id attribute of the modal which should be opened.
 text     - String. Text of the trigger.
 type     - String. 'a' or 'b', 'a' shows link style, 'b' shows button
            style. ( default: 'a' )
 icon     - String or Array. Glyph icon of trigger. Just like glyph_icon
            helper.
 options  - Other options can be accepted by link.

 Examples

   modal_trigger('modal', 'Click Me')
   # => <a href="#modal" id="trigger-modal" data-toggle="modal">
          Click Me
        </a>

   modal_trigger('modal', 'Click Me', type: 'b', icon: 'plus')
   # => <a href="#modal" id="trigger-modal" data-toggle="modal"
           class="btn">
          <i class="icon-plus"></i>
          Click Me
        </a>

 Returns a link which can open the modal.