public
Created

twitter bootstrap homepage rails

  • Download Gist
_flashes.html.erb
HTML+ERB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<!-- app/views/common/_flashes.html.erb -->
 
<% unless flash[:notice].blank? %>
<div class="alert-message success">
<%= content_tag :div, flash[:notice] %>
</div>
<% end %>
 
<% unless flash[:error].blank? %>
<div class="alert-message error">
<%= content_tag :div, flash[:error] %>
</div>
<% end %>
 
<% unless flash[:alert].blank? %>
<div class="alert-message warning">
<%= content_tag :div, flash[:alert] %>
</div>
<% end %>
application.css
CSS
1 2 3 4 5
// app/assets/stylesheets/application.css
 
body {
padding-top: 60px;
}
application.html.erb
HTML+ERB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<!-- app/views/layouts/application.html.erb -->
 
<!DOCTYPE html>
<html>
<head>
<title>Rails32bootstrap</title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
</head>
<body>
 
<div class="topbar">
<div class="fill">
<div class="container">
<a class="brand" href="#">Project name</a>
 
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div>
</div>
 
</div>
<div class="container">
<%= render :partial => 'common/flashes' %>
<%= yield %>
<footer>
<p>&copy; Company 2011</p>
 
</footer>
</div><!-- /container -->
 
</body>
</html>
index.html.erb
HTML+ERB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<!-- app/views/home/index.html.erb -->
<!-- Main hero unit for a primary marketing message or call to action -->
<div class="hero-unit">
<h1>Hello, world!</h1>
<p>Vestibulum id ligula porta felis euismod semper. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
<p><a class="btn primary large">Learn more &raquo;</a></p>
 
</div>
 
<!-- Example row of columns -->
<div class="row">
<div class="span6">
<h2>Heading</h2>
<p>Etiam porta sem malesuada magna mollis euismod. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
<p><a class="btn" href="#">View details &raquo;</a></p>
 
</div>
<div class="span5">
<h2>Heading</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div>
<div class="span5">
 
<h2>Heading</h2>
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p>
<p><a class="btn" href="#">View details &raquo;</a></p>
</div>
</div>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.