Adding Bootstrap to Rails
Download Bootstrap
Copy bootstrap/dist/css/bootstrap.css and bootstrap/dist/css/bootstrap.min.css to vendor/assets/stylesheets
Copy bootstrap/dist/js/bootstrap.js and bootstrap/dist/js/bootstrap.min.js to vendor/assets/javascripts
Update app/assets/stylesheets/application.css *= require bootstrap
Update app/assets/javascripts/application.js //= require bootstrap
Default application.haml view
!!!
%html
%head
%title Openseas
= stylesheet_link_tag " application" , media: " all" , " data-turbolinks-track" => true
= javascript_include_tag " application" , " data-turbolinks-track" => true
%meta {:content => " width=device-width, initial-scale=1.0" , :name => " viewport" }
= csrf_meta_tags
/[if lt IE 9]
<script src=" https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js" ></script>
<script src=" https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js" ></script>
%body
.container
= yield
config . wrappers :form_horizontal ,
hint_class : :field_with_hint , error_class : :field_with_errors do |b |
b . use :html5
b . use :placeholder
b . optional :maxlength
b . optional :pattern
b . optional :min_max
b . optional :readonly
b . use :label
b . use :input , wrap_with : { tag : :div , class : 'col-md-6' }
b . use :hint , wrap_with : { tag : :span , class : :hint }
b . use :error , wrap_with : { tag : :span , class : 'text-danger' }
end