Modals ====== Use the `modal` helper to insert a button that will toggle any type of [modal](http://getbootstrap.com/javascript/#modals) provided by Bootstrap. Basic modals ------------ ```erb <%= modal 'Click to toggle a modal', 'I am the content of the modal' %> ``` will generate the HTML to render a button that, when clicked, will toggle a modal with some simple text: ```html ``` Complex modals -------------- ```erb <%= modal 'Delete account', title: 'Confirm your action', dismissible: true, context: :danger, button_class: 'btn-sm', modal_class: 'modal-sm' do %> You are about to delete your account. Would you like to proceed? <%= footer do %> <% end %> <% end %> will generate the HTML to render a small "danger" (red) button that, when clicked, will toggle a small, dismissible modal with a title, some text, and a footer with a call-to-action: ```html ``` Panels ====== Use the `panel` helper to insert any type of [panel](http://getbootstrap.com/components/#panels) provided by Bootstrap. Basic panels ------------ ```erb <%= panel 'You have the right to remain silent...' %> ``` will generate the HTML to render a basic panel: ```html
You have the right to remain silent...
``` Panels with title ----------------- ```erb <%= panel 'You have the right to remain silent...', title: 'Your rights' %> ``` will generate the HTML to render a panel with a simple title header: ```html

Your rights

You have the right to remain silent...
``` Body and title can be passed as blocks if they are more than plain text: ```erb <%= panel do %> Hey! You have the right to remain silent... <%= title tag: :h3, do %> Your rights (from our <%= link_to '/terms', 'Terms of service' %>) <% end %> <% end %> ``` will generate ```html

Your rights (from our Terms of service)

Hey! You have the right to remain silent...
``` Contextual panels ----------------- ```erb <%= panel 'You have the right to remain silent...', title: 'Your rights', context: :warning %> ``` will generate the HTML to render a "warning" (orange border) panel: ```html

Your rights

You have the right to remain silent...
``` Panels with footer ------------------ ```erb <%= panel do %> You have the right to remain silent... <%= footer do %> <% end %> <% end %> ``` will generate the HTML to render a panel with a button in the footer: ```html
You have the right to remain silent...
``` Navbar ====== Basic navbar ------------ ```erb <%= navbar do %> <%= nav do %> <%= link_to 'Posts', '/posts' %> <%= link_to 'Users', '/users' %> <% end %> <% end %> ``` will generate the HTML to render an default navbar with two links: ```html ``` Complex navbar -------------- <%= navbar fixed: :top, inverted: true do %> <%= brand do %> <%= link_to image_tag('logo.png', alt: 'Company Name'), '/' %> <% end %> <%= nav do %> <%= link_to 'Posts', '/posts' %> <%= link_to 'Users', '/users' %> <% end %> <%= nav align: :right do %> <%= link_to 'Log in', '/login' %> <% end %> <% end %> Forms ===== <%= form_for %> <%= button_to %> <%= link_to %> Buttons ======= Viewport meta tag ================= <%= viewport_meta_tag %> generates