How to use bootstrap modal with rails?

Orsay

I would like to implement a boostrap modal in my rails application. The button is displaying but when I click on it nothing appears :

/ Trigger the modal with a button
%button.btn.btn-info.btn-lg{"data-target" => "#myModal", "data-toggle" => "modal", :type => "button"} Open Modal
/ Modal
#myModal.modal.fade{:role => "dialog"}
  .modal-dialog
    / Modal content
    .modal-content
      .modal-header
        %button.close{"data-dismiss" => "modal", :type => "button"} ×
        %h4.modal-title Modal Header
      .modal-body
        %p Some text in the modal.
      .modal-footer
        %button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close

I think I miss something. Those are my gems installed :

source 'https://rubygems.org'
gem 'bootstrap-sass', '~> 3.3.6'
gem 'twitter-bootstrap-rails', :git => 'git://github.com/seyhunak/twitter-bootstrap-rails.git'
gem 'haml', '~> 4.0', '>= 4.0.7'
gem 'foundation'
gem 'rails', '4.2.6'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
...

my application layout :

!!!
%html
  %head
    %title HealthyBox
    = stylesheet_link_tag    'application', media: 'all', 'data-turbolinks-track' => true
    = javascript_include_tag 'application', 'data-turbolinks-track' => true
    = csrf_meta_tags

application.css.scss

@import "bootstrap-sprockets";
@import "bootstrap";
hgsongra

Make sure you followed the below steps

Add below lines to app/assets/stylesheets/application.scss

@import "bootstrap-sprockets"; 
@import "bootstrap";

Note: Make sure the file has .scss extension (or .sass for Sass syntax). If you have just generated a new Rails app, it may come with a .css file instead

And below line to app/assets/javascripts/application.js

//= require bootstrap-sprockets

It will works fine.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Rails: How to add an object through a bootstrap modal?

From Java

How to use Bootstrap modal in Blazor client app?

From Dev

how to destroy a bootstrap modal but use again later

From Dev

How to use bootstrap modal to edit data in CodeIgniter

From Dev

Rails Bootstrap Modal not appearing

From Dev

Ruby on Rails bootstrap modal

From Dev

Rails Bootstrap Modal not appearing

From Dev

How to use the bootstrap confirmation within the bootstrap modal box?

From Dev

How to use the bootstrap confirmation within the bootstrap modal box?

From Dev

Render a Rails view in a Bootstrap modal

From Dev

Twitter Bootstrap Modal not working in Rails

From Dev

bootstrap modal with Simple Form Rails

From Dev

Issue with Bootstrap Modal with Rails App

From Dev

bootstrap modal dissappearing in rails 4

From Dev

How to use a Bootstrap modal to add fields to a form using jQuery

From Dev

How to use Bootstrap modal using the anchor tag for Register?

From Dev

How to use bootstrap modal on multiple images on same page on image click?

From Dev

How to use angular component with ui.bootstrap.modal in angular 1.5?

From Dev

How do I use Bootstrap modal in HTML table inside JavaScript?

From Dev

How to use hash value to open a bootstrap modal using jquery?

From Dev

How to use same bootstrap modal for 2 different submit buttons in django?

From Dev

How to use Bootstrap Multiselect in Rails views?

From Dev

bootstrap modal how to destroy

From Dev

Use bootstrap modal with href tag

From Dev

How to use bootstrap3-datetimepicker-rails gem on rails?

From Dev

Is there a way to use a Bootstrap popover inside a Bootstrap modal?

From Dev

How to switch from a bootstrap modal to a angular modal

From Dev

How to switch from a bootstrap modal to a angular modal

From Dev

Rails Devise Bootstrap Sign Up modal

Related Related

  1. 1

    Rails: How to add an object through a bootstrap modal?

  2. 2

    How to use Bootstrap modal in Blazor client app?

  3. 3

    how to destroy a bootstrap modal but use again later

  4. 4

    How to use bootstrap modal to edit data in CodeIgniter

  5. 5

    Rails Bootstrap Modal not appearing

  6. 6

    Ruby on Rails bootstrap modal

  7. 7

    Rails Bootstrap Modal not appearing

  8. 8

    How to use the bootstrap confirmation within the bootstrap modal box?

  9. 9

    How to use the bootstrap confirmation within the bootstrap modal box?

  10. 10

    Render a Rails view in a Bootstrap modal

  11. 11

    Twitter Bootstrap Modal not working in Rails

  12. 12

    bootstrap modal with Simple Form Rails

  13. 13

    Issue with Bootstrap Modal with Rails App

  14. 14

    bootstrap modal dissappearing in rails 4

  15. 15

    How to use a Bootstrap modal to add fields to a form using jQuery

  16. 16

    How to use Bootstrap modal using the anchor tag for Register?

  17. 17

    How to use bootstrap modal on multiple images on same page on image click?

  18. 18

    How to use angular component with ui.bootstrap.modal in angular 1.5?

  19. 19

    How do I use Bootstrap modal in HTML table inside JavaScript?

  20. 20

    How to use hash value to open a bootstrap modal using jquery?

  21. 21

    How to use same bootstrap modal for 2 different submit buttons in django?

  22. 22

    How to use Bootstrap Multiselect in Rails views?

  23. 23

    bootstrap modal how to destroy

  24. 24

    Use bootstrap modal with href tag

  25. 25

    How to use bootstrap3-datetimepicker-rails gem on rails?

  26. 26

    Is there a way to use a Bootstrap popover inside a Bootstrap modal?

  27. 27

    How to switch from a bootstrap modal to a angular modal

  28. 28

    How to switch from a bootstrap modal to a angular modal

  29. 29

    Rails Devise Bootstrap Sign Up modal

HotTag

Archive