Tag: Rails/Bootstrap
gem 'bootstrap-sass', '~> 3.3.4' gem 'font-awesome-sass'
bundle install --path vendor/bundle
@import "bootstrap-sprockets"; @import "bootstrap"; @import "font-awesome-sprockets"; @import "font-awesome";
//= require bootstrap-sprockets
bundle exec rails g scaffold book title:string author:string summary:text bundle exec rake db:migrate
<nav class="navbar navbar-default" role="navigation"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="/"><i class="fa fa-home"></i>Home</a> </div> <div class="navbar-collapse collapse"> <ul class="nav navbar-nav"> <li><a href="http://www.google.com/" target="_blank">Google</a></li> <li><a href="http://www.yahoo.co.jp/" target="_blank">Yahoo! Japan</a></li> </ul> <ul class="nav navbar-nav navbar-left"> <div class="form-group"> <%= form_tag('/softwares', method: 'get', class: 'navbar-form navbar-right') do %> <%= text_field_tag(:q, params[:q], class: 'form-control', style: 'width: 200px;', placeholder: 'Search') %> <% end %> </div> </ul> </div> </div><!-- /.container-fluid --> </nav> <div class="container"> <!-- flash messages --> <%= yield %> <hr> <footer> <p>© src256</p> </footer> </div>