Skip to content

Instantly share code, notes, and snippets.

@oma
Created January 29, 2012 12:29
Show Gist options
  • Save oma/1698584 to your computer and use it in GitHub Desktop.
Save oma/1698584 to your computer and use it in GitHub Desktop.
twitter bootstrap homepage rails
<!-- 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 %>
// app/assets/stylesheets/application.css
body {
padding-top: 60px;
}
<!-- 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>
<!-- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment