Sha256: 65b33015839f19309bc15470e2df3ded5f7d18c5b5ff00efecfe0d3852e23e62
Contents?: true
Size: 1.91 KB
Versions: 7
Compression:
Stored size: 1.91 KB
Contents
module UiBibz::Ui::Core::Forms::Buttons # Create a button link # # This element is an extend of UiBibz::Ui::Core::Forms::Buttons::Button. # # ==== Attributes # # * +content+ - Content of element # * +options+ - Options of element # * +html_options+ - Html Options of element # # ==== Options # # You can add HTML attributes using the +html_options+. # You can pass arguments in options attribute: # * +status+ - status of élement with symbol value: # (+:primary+, +:secondary+, +:info+, +:warning+, +:danger+) # * +size+ # (+:xs+, +:sm+, +:lg+) # * +url+ - String url # * +outline+ - Boolean # * +state+ - Symbol (+:active+, +:disabled) # * +type+ - Symbol (+:block) # * +glyph+ - Add glyph with name or hash options # * +name+ - String # * +size+ - Integer # * +type+ - Symbol # # ==== Signatures # # UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new(content, options = nil, html_options = nil) # # UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new(options = nil, html_options = nil) do # content # end # # ==== Examples # # UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new('test', type: :primary, url: '#') # # UiBibz::Ui::Core::Forms::Buttons::ButtonLink.new(type: :primary, url: '#') do # test # end.render # # ==== Helper # # button_link(content, options = {}, html_options = {}) # # button_link(options = {}, html_options = {}) do # content # end # class ButtonLink < UiBibz::Ui::Core::Forms::Buttons::Button # See UiBibz::Ui::Core::Forms::Buttons::Button def initialize content = nil, options = nil, html_options = nil, &block super end # Render html tag def render link_to glyph_and_content_html, link_url, html_options end private def link_url options[:url] || "#" end def component_html_classes ['btn', size, type] end end end
Version data entries
7 entries across 7 versions & 1 rubygems