Permalink
Browse files

hey a new branch

  • Loading branch information...
1 parent 2a035e1 commit a8c0d62b925473eef3d68b9ed7183f71145a6059 @jholton committed Feb 22, 2013
View
@@ -1,15 +1,13 @@
source 'https://rubygems.org'
gem 'rails', '3.2.12'
+gem 'bootstrap-sass', '2.1'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
end
-# Gems used only for assets and not required
-# # in production environments by default.
-
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
View
@@ -29,6 +29,7 @@ GEM
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
+ bootstrap-sass (2.1.0.0)
builder (3.0.4)
capybara (1.1.2)
mime-types (>= 1.16)
@@ -50,7 +51,7 @@ GEM
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
- ffi (1.3.1)
+ ffi (1.4.0)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
@@ -111,7 +112,7 @@ GEM
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
- selenium-webdriver (2.29.0)
+ selenium-webdriver (2.30.0)
childprocess (>= 0.2.5)
multi_json (~> 1.0)
rubyzip
@@ -139,6 +140,7 @@ PLATFORMS
ruby
DEPENDENCIES
+ bootstrap-sass (= 2.1)
capybara (= 1.1.2)
coffee-rails (= 3.2.2)
jquery-rails (= 2.0.2)
@@ -0,0 +1,2 @@
+// Place all the behaviors and hooks related to the matching controller here.
+// All this logic will automatically be available in application.js.
@@ -0,0 +1,102 @@
+@import "bootstrap";
+
+/* mixins, variables, etc. */
+
+$grayMediumLight: #eaeaea;
+
+/* universal */
+
+html {
+ overflow-y: scroll;
+}
+
+body {
+ padding-top: 60px;
+}
+
+section {
+ overflow: auto;
+}
+
+textarea {
+ resize: vertical;
+}
+
+.center {
+ text-align: center;
+ h1 {
+ margin-bottom: 10px;
+ }
+}
+
+/* typography */
+
+h1, h2, h3, h4, h5, h6 {
+ line-height: 1;
+}
+
+h1 {
+ font-size: 3em;
+ letter-spacing: -2px;
+ margin-bottom: 30px;
+ text-align: center;
+}
+
+h2 {
+ font-size: 1.7em;
+ letter-spacing: -1px;
+ margin-bottom: 30px;
+ text-align: center;
+ font-weight: normal;
+ color: $grayLight;
+}
+
+p {
+ font-size: 1.1em;
+ line-height: 1.7em;
+}
+
+
+/* header */
+
+#logo {
+ float: left;
+ margin-right: 10px;
+ font-size: 1.7em;
+ color: white;
+ text-transform: uppercase;
+ letter-spacing: -1px;
+ padding-top: 9px;
+ font-weight: bold;
+ line-height: 1;
+ &:hover {
+ color: white;
+ text-decoration: none;
+ }
+}
+
+/* footer */
+
+footer {
+ margin-top: 45px;
+ padding-top: 5px;
+ border-top: 1px solid $grayMediumLight;
+ color: $grayLight;
+ a {
+ color: $gray;
+ &:hover {
+ color: $grayDarker;
+ }
+ }
+ small {
+ float: left;
+ }
+ ul {
+ float: right;
+ list-style: none;
+ li {
+ float: left;
+ margin-left: 10px;
+ }
+ }
+}
@@ -0,0 +1,3 @@
+// Place all the styles related to the Users controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
@@ -7,4 +7,7 @@ def help
def about
end
+ def contact
+
+ end
end
@@ -0,0 +1,4 @@
+class UsersController < ApplicationController
+ def new
+ end
+end
@@ -1,2 +1,10 @@
module ApplicationHelper
+ def full_title(page_title)
+ base_title = "Ruby on Rails Tutorial Sample App"
+ if page_title.empty?
+ base_title
+ else
+ "#{base_title} | #{page_title}"
+ end
+ end
end
@@ -0,0 +1,2 @@
+module UsersHelper
+end
@@ -0,0 +1,13 @@
+<footer class="footer">
+ <small>
+ <a href="http://railstutorial.org/">Rails Tutorial</a>
+ by Michael Hartl
+ </small>
+ <nav>
+ <ul>
+ <li><%= link_to "About", about_path %></li>
+ <li><%= link_to "Contact", contact_path %></li>
+ <li><a href="http://news.railstutorial.org/">News</a></li>
+ </ul>
+ </nav>
+</footer>
@@ -0,0 +1,14 @@
+<header class="navbar navbar-fixed-top navbar-inverse">
+ <div class="navbar-inner">
+ <div class="container">
+ <%= link_to "sample app", root_path, id: "logo" %>
+ <nav>
+ <ul class="nav pull-right">
+ <li><%= link_to "Home", root_path %></li>
+ <li><%= link_to "Help", help_path %></li>
+ <li><%= link_to "Sign in", '#' %></li>
+ </ul>
+ </nav>
+ </div>
+ </div>
+</header>
@@ -0,0 +1,3 @@
+<!--[if lt IE 9]>
+<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
+<![endif]-->
@@ -1,14 +1,18 @@
<!DOCTYPE html>
<html>
-<head>
-<title>Ruby on Rails Tutorial Sample App | <%= yield(:title) %></title>
- <%= stylesheet_link_tag "application", :media => "all" %>
- <%= javascript_include_tag "application" %>
- <%= csrf_meta_tags %>
-</head>
-<body>
+ <head>
+ <title><%= full_title(yield(:title)) %></title>
+ <%= stylesheet_link_tag "application", media: "all" %>
+ <%= javascript_include_tag "application" %>
+ <%= csrf_meta_tags %>
+ <%= render 'layouts/shim' %>
+ </head>
+ <body>
+ <%= render "layouts/header" %>
+ <div class="container">
+ <%= yield %>
+ <%= render 'layouts/footer' %>
+ </div>
+ </body>
+ </html>
-<%= yield %>
-
-</body>
-</html>
@@ -0,0 +1,9 @@
+
+<% provide(:title, 'Contact Us') %>
+<h1>Contact Us</h1>
+<p>
+ The <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
+ is a project to make a book and screencasts to teach web development
+ with <a href="http://rubyonrails.org/">Ruby on Rails</a>. This
+ is the sample application for the tutorial.
+ </p>
@@ -1,7 +1,13 @@
-<% provide(:title, 'Home') %>
-<h1>Sample App</h1>
-<p>
- This is the home page for the
- <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
- sample application.
- </p>
+<div class="center hero-unit">
+ <h1>Welcome to the Sample App</h1>
+
+ <h2>
+ This is the home page for the
+ <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
+ sample application.
+ </h2>
+
+ <%= link_to "Sign up now!", signup_path, class: "btn btn-large btn-primary" %>
+ </div>
+
+ <%= link_to image_tag("rails.png", alt: "Rails"), 'http://rubyonrails.org/' %>
@@ -0,0 +1,2 @@
+<h1>Users#new</h1>
+<p>Find me in app/views/users/new.html.erb</p>
View
@@ -1,68 +1,11 @@
require File.expand_path('../boot', __FILE__)
-# Pick the frameworks you want:
-require "active_record/railtie"
-require "action_controller/railtie"
-require "action_mailer/railtie"
-require "active_resource/railtie"
-require "sprockets/railtie"
-# require "rails/test_unit/railtie"
-
-if defined?(Bundler)
- # If you precompile assets before deploying to production, use this line
- Bundler.require(*Rails.groups(:assets => %w(development test)))
- # If you want your assets lazily compiled in production, use this line
- # Bundler.require(:default, :assets, Rails.env)
-end
+require 'rails/all'
+Bundler.require(:default, Rails.env) if defined?(Bundler)
module SampleApp
class Application < Rails::Application
- # Settings in config/environments/* take precedence over those specified here.
- # Application configuration should go into files in config/initializers
- # -- all .rb files in that directory are automatically loaded.
-
- # Custom directories with classes and modules you want to be autoloadable.
- # config.autoload_paths += %W(#{config.root}/extras)
-
- # Only load the plugins named here, in the order given (default is alphabetical).
- # :all can be used as a placeholder for all plugins not explicitly named.
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
-
- # Activate observers that should always be running.
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
-
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
- # config.time_zone = 'Central Time (US & Canada)'
-
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
- # config.i18n.default_locale = :de
-
- # Configure the default encoding used in templates for Ruby 1.9.
config.encoding = "utf-8"
-
- # Configure sensitive parameters which will be filtered from the log file.
config.filter_parameters += [:password]
-
- # Enable escaping HTML in JSON.
- config.active_support.escape_html_entities_in_json = true
-
- # Use SQL instead of Active Record's schema dumper when creating the database.
- # This is necessary if your schema can't be completely dumped by the schema dumper,
- # like if you have constraints or database-specific column types
- # config.active_record.schema_format = :sql
-
- # Enforce whitelist mode for mass assignment.
- # This will create an empty whitelist of attributes available for mass-assignment for all models
- # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
- # parameters by using an attr_accessible or attr_protected declaration.
- config.active_record.whitelist_attributes = true
-
- # Enable the asset pipeline
- config.assets.enabled = true
-
- # Version of your assets, change this if you want to expire all your assets
- config.assets.version = '1.0'
end
end
View
@@ -1,17 +1,8 @@
-# SQLite version 3.x
-# gem install sqlite3
-#
-# Ensure the SQLite 3 gem is defined in your Gemfile
-# gem 'sqlite3'
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
-
-# Warning: The database defined as "test" will be erased and
-# re-generated from your development database when you run "rake".
-# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
@@ -23,11 +23,11 @@
config.action_dispatch.best_standards_support = :builtin
# Raise exception on mass assignment protection for Active Record models
- config.active_record.mass_assignment_sanitizer = :strict
+# config.active_record.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL)
- config.active_record.auto_explain_threshold_in_seconds = 0.5
+# config.active_record.auto_explain_threshold_in_seconds = 0.5
# Do not compress assets
config.assets.compress = false
Oops, something went wrong.

0 comments on commit a8c0d62

Please sign in to comment.