Skip to content

Instantly share code, notes, and snippets.

@jlittlejohn
Last active May 1, 2019 16:03
Show Gist options
  • Save jlittlejohn/6174665 to your computer and use it in GitHub Desktop.
Save jlittlejohn/6174665 to your computer and use it in GitHub Desktop.
RoR: Add Modal to a View
= link_to image_tag("imageName.png", :alt => 'Image Name', :class => 'class-name'), '#myModal', :data => {:toggle => 'modal'}
#myModal.modal.fade
.modal-dialog
.modal-content
.modal-header
%button.close{:data => {:dismiss => 'modal'}, :aria => {:hidden => 'true'}}
×
%h4.modal-title
Title
.modal-body
%p
Content
.modal-footer
%button.btn.btn-default{:data => {:dismiss => 'modal'}
Close
%button.btn.btn-primary
Save changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment