Created
October 23, 2013 12:09
-
-
Save diego-aslz/7117441 to your computer and use it in GitHub Desktop.
Bootstrap Helpers for Rails.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ModalDialogHelper | |
def modal_dialog(options={},&block) | |
content_tag :div, {class: 'modal hide fade', tabindex: -1, role: 'dialog'}.merge(options), &block | |
end | |
def modal_header(options={},&block) | |
content_tag :div, {class: 'modal-header'}.merge(options), &block | |
end | |
def modal_body(options={},&block) | |
content_tag :div, {class: 'modal-body'}.merge(options), &block | |
end | |
def modal_footer(options={},&block) | |
content_tag :div, {class: 'modal-footer'}.merge(options), &block | |
end | |
def modal_close(options={}) | |
content_tag :button, 'X', {class: 'close', :'data-dismiss' => :modal, type: :button}.merge(options) | |
end | |
def modal_cancel(options={}) | |
content_tag :button, options.delete(:caption), {class: 'btn', :'data-dismiss' => :modal}.merge(options) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment