Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Added bootstrap-sass gem and added twitter bootstrap css to the app
  • Loading branch information
ketan21 committed Jul 14, 2012
1 parent 30b63bd commit 73179fb
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Expand Up @@ -4,15 +4,15 @@ gem 'rails', '3.2.2'

gem 'sqlite3'
gem 'spork'
gem 'bootstrap-sass'
gem 'jquery-rails'

group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

group :development do
gem 'rspec-rails', '2.11.0'
gem 'annotated-rails'
Expand Down
2 changes: 2 additions & 0 deletions Gemfile.lock
Expand Up @@ -31,6 +31,7 @@ GEM
annotated-rails (0.0.2)
activerecord (>= 3.0.0)
arel (3.0.2)
bootstrap-sass (2.0.3.1)
builder (3.0.0)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
Expand Down Expand Up @@ -132,6 +133,7 @@ PLATFORMS

DEPENDENCIES
annotated-rails
bootstrap-sass
coffee-rails (~> 3.2.1)
factory_girl_rails
jquery-rails
Expand Down
1 change: 1 addition & 0 deletions app/assets/javascripts/application.js
Expand Up @@ -13,3 +13,4 @@
//= require jquery
//= require jquery_ujs
//= require_tree .
//= require bootstrap
53 changes: 53 additions & 0 deletions app/assets/stylesheets/application.css.scss
@@ -0,0 +1,53 @@
/*
* This is a manifest file that'll be compiled into application.css, which will include all the files
* listed below.
*
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
*
* You're free to add application-wide styles to this file and they'll appear at the top of the
* compiled file, but it's generally better to create a new file per style scope.
*
*= require_self
*= require_tree .
*/

.content {
background-color: #eee;
padding: 20px;
margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
-webkit-border-radius: 0 0 6px 6px;
-moz-border-radius: 0 0 6px 6px;
border-radius: 0 0 6px 6px;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,.15);
-moz-box-shadow: 0 1px 2px rgba(0,0,0,.15);
box-shadow: 0 1px 2px rgba(0,0,0,.15);
}

html, body, .container, .content {
height: 100%;
}

.container, .content {
position: relative;
}

.wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -50px; /* same as the footer */
}

.push {
height: 50px; /* same as the footer */
}
.footer-wrapper {
position: relative;
height: 50px;
}

footer{
text-align: center;
display: block inline;
}
3 changes: 3 additions & 0 deletions app/assets/stylesheets/bootstrap_and_overrides.css.scss
@@ -0,0 +1,3 @@
@import "bootstrap";
body { padding-top: 60px; }
@import "bootstrap-responsive";
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Expand Up @@ -2,7 +2,7 @@ class UsersController < ApplicationController

def show
@user = User.find(params[:id])
@title = @user.name + "<script>"
@title = @user.name
end

def new
Expand Down
13 changes: 5 additions & 8 deletions app/views/layouts/_footer.html.erb
@@ -1,9 +1,6 @@
<footer>
<nav class="round">
<ul>
<li><%= link_to "About", about_path %></li>
<li><%= link_to "Contact", contact_path %></li>
<li><%= link_to "Tutorial", 'http://railstutorial.org' %></li>
</ul>
</nav>
</footer>
<li><%= link_to "About", about_path %></li>
<li><%= link_to "Contact", contact_path %></li>
<li><%= link_to "Tutorial", 'http://railstutorial.org' %></li>
</ul>
</footer>
24 changes: 17 additions & 7 deletions app/views/layouts/_header.html.erb
@@ -1,10 +1,20 @@
<header>
<%= link_to logo, root_path %>
<!-- <header>
<nav class ="round">
<ul class="list">
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Help", help_path %></li>
<li><%= link_to "Sign in", signup_path %></li>
</ul>
</nav>
</header>
-->

<header class="navbar navbar-fixed-top">
<nav class="navbar-inner">
<div class="container">
<ul class="nav">
<li><%= link_to "Home", root_path %></li>
<li><%= link_to "Help", help_path %></li>
<li><%= link_to "Sign in", signup_path %></li>
</ul>
</div>
</nav>
<%= link_to logo, root_path %>
</header>
13 changes: 3 additions & 10 deletions app/views/layouts/_stylesheets.html.erb
@@ -1,10 +1,3 @@
<%= stylesheet_link_tag 'blueprint/screen', :media => 'screen' %>
<%= stylesheet_link_tag 'blueprint/print', :media => 'print' %>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js">
</script>
<![endif]-->
<!--[if lt IE 8]
<%= stylesheet_link_tag 'blueprint/ie' %>
<![endif]-->
<%= stylesheet_link_tag 'custom', :media => 'screen'%>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
25 changes: 18 additions & 7 deletions app/views/layouts/application.html.erb
Expand Up @@ -2,16 +2,27 @@
<html>
<head>
<title><%= title %></title>
<%= csrf_meta_tags %>
<%= render 'layouts/stylesheets' %>
</head>
<body>
<div class="container">
<%= render 'layouts/header' %>
<section class="round">
<%= yield %>
</section>
<%= render 'layouts/footer' %>
</div>
<div id="main" role="main">
<div class="container">
<div class="content">
<div class="wrapper">
<div class="row">
<div class="span12">
<%= yield %>
</div>
</div>
<div class="push"></div>
</div>
<div class="footer-wrapper">
<%= render 'layouts/footer' %>
</div>
</div>
</div> <!--! end of .container -->
</div> <!--! end of #main -->

</body>
</html>
11 changes: 11 additions & 0 deletions spec/controllers/users_controller_spec.rb
Expand Up @@ -19,8 +19,19 @@
assigns(:user).should == @user
end

it "should have a right title" do
get :show, :id => @user
response.should have_selector('title', :content => @user.name)
end

it "should have user's name" do
get :show, :id => @user
response.should have_selector('h1', :content => @user.name)
end

end


describe "GET 'new'" do
it "returns http success" do
get :new
Expand Down

0 comments on commit 73179fb

Please sign in to comment.