Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

devise basics added

  • Loading branch information...
commit 7c2a3c44c79cd94a80afa1554c67b44eb482a63d 1 parent 6913804
Fenec authored
Showing with 608 additions and 257 deletions.
  1. +10 −4 Gemfile
  2. +133 −0 Gemfile.lock
  3. +15 −0 ROADMAP
  4. +8 −0 app/controllers/pages_controller.rb
  5. +9 −0 app/controllers/words_controller.rb
  6. +2 −0  app/helpers/pages_helper.rb
  7. +2 −0  app/helpers/words_helper.rb
  8. +9 −0 app/models/user.rb
  9. +2 −0  app/models/word.rb
  10. +10 −1 app/views/layouts/application.html.erb
  11. +15 −0 app/views/pages/home.erb
  12. +41 −12 config/database.yml
  13. +3 −0  config/environments/development.rb
  14. +142 −0 config/initializers/devise.rb
  15. +39 −0 config/locales/devise.en.yml
  16. +3 −1 config/routes.rb
  17. +12 −0 db/migrate/20110224095226_create_words.rb
  18. +11 −0 db/migrate/20110224124529_add_word_and_definiton_to_words.rb
  19. +11 −0 db/migrate/20110224134357_add_rating_and_category_to_words.rb
  20. +26 −0 db/migrate/20110225180242_devise_create_users.rb
  21. +43 −0 db/schema.rb
  22. +0 −239 public/index.html
  23. +11 −0 test/fixtures/users.yml
  24. +11 −0 test/fixtures/words.yml
  25. +8 −0 test/functional/pages_controller_test.rb
  26. +8 −0 test/functional/words_controller_test.rb
  27. +4 −0 test/unit/helpers/pages_helper_test.rb
  28. +4 −0 test/unit/helpers/words_helper_test.rb
  29. +8 −0 test/unit/user_test.rb
  30. +8 −0 test/unit/word_test.rb
View
14 Gemfile
@@ -5,7 +5,10 @@ gem 'rails', '3.0.4'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
-gem 'sqlite3'
+gem 'mysql2'
+gem 'devise'
+gem 'cancan'
+gem 'nifty-generators'
# Use unicorn as the web server
# gem 'unicorn'
@@ -26,6 +29,9 @@ gem 'sqlite3'
# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
-# group :development, :test do
-# gem 'webrat'
-# end
+ group :development, :test do
+ gem 'cucumber'
+ gem 'rspec'
+ gem 'factory_girl'
+ gem 'capybara'
+ end
View
133 Gemfile.lock
@@ -0,0 +1,133 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionmailer (3.0.4)
+ actionpack (= 3.0.4)
+ mail (~> 2.2.15)
+ actionpack (3.0.4)
+ activemodel (= 3.0.4)
+ activesupport (= 3.0.4)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.4)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.13)
+ rack-test (~> 0.5.7)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.4)
+ activesupport (= 3.0.4)
+ builder (~> 2.1.2)
+ i18n (~> 0.4)
+ activerecord (3.0.4)
+ activemodel (= 3.0.4)
+ activesupport (= 3.0.4)
+ arel (~> 2.0.2)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.4)
+ activemodel (= 3.0.4)
+ activesupport (= 3.0.4)
+ activesupport (3.0.4)
+ arel (2.0.8)
+ bcrypt-ruby (2.1.4)
+ builder (2.1.2)
+ cancan (1.5.1)
+ capybara (0.4.1.2)
+ celerity (>= 0.7.9)
+ culerity (>= 0.2.4)
+ mime-types (>= 1.16)
+ nokogiri (>= 1.3.3)
+ rack (>= 1.0.0)
+ rack-test (>= 0.5.4)
+ selenium-webdriver (>= 0.0.27)
+ xpath (~> 0.1.3)
+ celerity (0.8.8)
+ childprocess (0.1.7)
+ ffi (~> 0.6.3)
+ cucumber (0.10.0)
+ builder (>= 2.1.2)
+ diff-lcs (~> 1.1.2)
+ gherkin (~> 2.3.2)
+ json (~> 1.4.6)
+ term-ansicolor (~> 1.0.5)
+ culerity (0.2.15)
+ devise (1.1.5)
+ bcrypt-ruby (~> 2.1.2)
+ warden (~> 1.0.2)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ factory_girl (1.3.3)
+ ffi (0.6.3)
+ rake (>= 0.8.7)
+ gherkin (2.3.3)
+ json (~> 1.4.6)
+ i18n (0.5.0)
+ json (1.4.6)
+ json_pure (1.5.1)
+ mail (2.2.15)
+ activesupport (>= 2.3.6)
+ i18n (>= 0.4.0)
+ mime-types (~> 1.16)
+ treetop (~> 1.4.8)
+ mime-types (1.16)
+ mysql2 (0.2.6)
+ nifty-generators (0.4.5)
+ nokogiri (1.4.4)
+ polyglot (0.3.1)
+ rack (1.2.1)
+ rack-mount (0.6.13)
+ rack (>= 1.0.0)
+ rack-test (0.5.7)
+ rack (>= 1.0)
+ rails (3.0.4)
+ actionmailer (= 3.0.4)
+ actionpack (= 3.0.4)
+ activerecord (= 3.0.4)
+ activeresource (= 3.0.4)
+ activesupport (= 3.0.4)
+ bundler (~> 1.0)
+ railties (= 3.0.4)
+ railties (3.0.4)
+ actionpack (= 3.0.4)
+ activesupport (= 3.0.4)
+ rake (>= 0.8.7)
+ thor (~> 0.14.4)
+ rake (0.8.7)
+ rspec (2.5.0)
+ rspec-core (~> 2.5.0)
+ rspec-expectations (~> 2.5.0)
+ rspec-mocks (~> 2.5.0)
+ rspec-core (2.5.1)
+ rspec-expectations (2.5.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.5.0)
+ rubyzip (0.9.4)
+ selenium-webdriver (0.1.3)
+ childprocess (~> 0.1.5)
+ ffi (~> 0.6.3)
+ json_pure
+ rubyzip
+ term-ansicolor (1.0.5)
+ thor (0.14.6)
+ treetop (1.4.9)
+ polyglot (>= 0.3.1)
+ tzinfo (0.3.24)
+ warden (1.0.3)
+ rack (>= 1.0.0)
+ xpath (0.1.3)
+ nokogiri (~> 1.3)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ cancan
+ capybara
+ cucumber
+ devise
+ factory_girl
+ mysql2
+ nifty-generators
+ rails (= 3.0.4)
+ rspec
View
15 ROADMAP
@@ -0,0 +1,15 @@
+ADD:
+
+pagination
+sorting by date, popularity in catalog
+captcha
+user auth, profiles
+showing author for a word, rating of author
+reference. from where word was taken
+rating of a word
+adding picture
+word of a day, week, month etc
+integration with memonauts
+category separation
+search for a word/phrase
+
View
8 app/controllers/pages_controller.rb
@@ -0,0 +1,8 @@
+class PagesController < ApplicationController
+
+ def home
+ @words_list = Word.all
+ render :action => 'home'
+ end
+
+end
View
9 app/controllers/words_controller.rb
@@ -0,0 +1,9 @@
+class WordsController < ApplicationController
+
+ attr_accessible :word, :definiton, :author
+
+ def add_word
+
+ end
+
+end
View
2  app/helpers/pages_helper.rb
@@ -0,0 +1,2 @@
+module PagesHelper
+end
View
2  app/helpers/words_helper.rb
@@ -0,0 +1,2 @@
+module WordsHelper
+end
View
9 app/models/user.rb
@@ -0,0 +1,9 @@
+class User < ActiveRecord::Base
+ # Include default devise modules. Others available are:
+ # :token_authenticatable, :confirmable, :lockable and :timeoutable
+ devise :database_authenticatable, :registerable,
+ :recoverable, :rememberable, :trackable, :validatable
+
+ # Setup accessible (or protected) attributes for your model
+ attr_accessible :email, :password, :password_confirmation, :remember_me
+end
View
2  app/models/word.rb
@@ -0,0 +1,2 @@
+class Word < ActiveRecord::Base
+end
View
11 app/views/layouts/application.html.erb
@@ -7,8 +7,17 @@
<%= csrf_meta_tag %>
</head>
<body>
-
+<div id="container">
+<div id="user">
+ <% if user_signed_in? %>
+ <%= current_user.email %>
+ <%= link_to "Sign out", destroy_user_session_path %>
+ <% else %>
+ <%= link_to "Sign Up", new_user_registration_path %> or <%= link_to "Sign In", new_user_session_path %>
+ <% end %>
+</div>
<%= yield %>
+</div>
</body>
</html>
View
15 app/views/pages/home.erb
@@ -0,0 +1,15 @@
+Hi!
+This is my project that show you a list of cool english words
+
+<% for word in @words_list do %>
+<p>Word
+<%= word.word.inspect() %>
+</p>
+<p>
+Definition
+<%= word.definition.inspect() %>
+</p>
+<p>by
+</p>
+---
+<% end %>
View
53 config/database.yml
@@ -1,22 +1,51 @@
-# SQLite version 3.x
-# gem install sqlite3
+# MySQL. Versions 4.1 and 5.0 are recommended.
+#
+# Install the MySQL driver:
+# gem install mysql
+# On Mac OS X:
+# sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
+# On Mac OS X Leopard:
+# sudo env ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
+# This sets the ARCHFLAGS environment variable to your native architecture
+# On Windows:
+# gem install mysql
+# Choose the win32 build.
+# Install MySQL and put its /bin directory on your path.
+#
+# And be sure to use new-style password hashing:
+# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
- adapter: sqlite3
- database: db/development.sqlite3
+ adapter: mysql2
+ encoding: utf8
+ reconnect: false
+ database: cw_development
pool: 5
- timeout: 5000
+ username: root
+ password: admin
+# socket: /tmp/mysql.sock
# 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
+test: &TEST
+ adapter: mysql2
+ encoding: utf8
+ reconnect: false
+ database: cw_test
pool: 5
- timeout: 5000
+ username: root
+ password: admin
+# socket: /tmp/mysql.sock
production:
- adapter: sqlite3
- database: db/production.sqlite3
+ adapter: mysql2
+ encoding: utf8
+ reconnect: false
+ database: cw_production
pool: 5
- timeout: 5000
+ username: root
+ password:
+ socket: /var/run/mysqld/mysqld.sock
+
+cucumber:
+ <<: *TEST
View
3  config/environments/development.rb
@@ -22,5 +22,8 @@
# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin
+
+ config.action_mailer.default_url_options = { :host => 'localhost:3000' }
+
end
View
142 config/initializers/devise.rb
@@ -0,0 +1,142 @@
+# Use this hook to configure devise mailer, warden hooks and so forth. The first
+# four configuration values can also be set straight in your models.
+Devise.setup do |config|
+ # ==> Mailer Configuration
+ # Configure the e-mail address which will be shown in DeviseMailer.
+ config.mailer_sender = "please-change-me@config-initializers-devise.com"
+
+ # Configure the class responsible to send e-mails.
+ # config.mailer = "Devise::Mailer"
+
+ # ==> ORM configuration
+ # Load and configure the ORM. Supports :active_record (default) and
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
+ # available as additional gems.
+ require 'devise/orm/active_record'
+
+ # ==> Configuration for any authentication mechanism
+ # Configure which keys are used when authenticating an user. By default is
+ # just :email. You can configure it to use [:username, :subdomain], so for
+ # authenticating an user, both parameters are required. Remember that those
+ # parameters are used only when authenticating and not when retrieving from
+ # session. If you need permissions, you should implement that in a before filter.
+ # config.authentication_keys = [ :email ]
+
+ # Tell if authentication through request.params is enabled. True by default.
+ # config.params_authenticatable = true
+
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
+ # config.http_authenticatable = false
+
+ # Set this to true to use Basic Auth for AJAX requests. True by default.
+ # config.http_authenticatable_on_xhr = true
+
+ # The realm used in Http Basic Authentication
+ # config.http_authentication_realm = "Application"
+
+ # ==> Configuration for :database_authenticatable
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
+ # using other encryptors, it sets how many times you want the password re-encrypted.
+ config.stretches = 10
+
+ # Define which will be the encryption algorithm. Devise also supports encryptors
+ # from others authentication tools as :clearance_sha1, :authlogic_sha512 (then
+ # you should set stretches above to 20 for default behavior) and :restful_authentication_sha1
+ # (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
+ config.encryptor = :bcrypt
+
+ # Setup a pepper to generate the encrypted password.
+ config.pepper = "94d049fd177fd93d77a3cbdf460652ca9f5c77844a4e066d8bcb5703701c5550b990effecb7c5f5130e0e33647ab242ffd2f597583d3011109706ea7fd6580c7"
+
+ # ==> Configuration for :confirmable
+ # The time you want to give your user to confirm his account. During this time
+ # he will be able to access your application without confirming. Default is nil.
+ # When confirm_within is zero, the user won't be able to sign in without confirming.
+ # You can use this to let your user access some features of your application
+ # without confirming the account, but blocking it after a certain period
+ # (ie 2 days).
+ # config.confirm_within = 2.days
+
+ # ==> Configuration for :rememberable
+ # The time the user will be remembered without asking for credentials again.
+ # config.remember_for = 2.weeks
+
+ # If true, a valid remember token can be re-used between multiple browsers.
+ # config.remember_across_browsers = true
+
+ # If true, extends the user's remember period when remembered via cookie.
+ # config.extend_remember_period = false
+
+ # ==> Configuration for :validatable
+ # Range for password length
+ # config.password_length = 6..20
+
+ # Regex to use to validate the email address
+ # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
+
+ # ==> Configuration for :timeoutable
+ # The time you want to timeout the user session without activity. After this
+ # time the user will be asked for credentials again.
+ # config.timeout_in = 10.minutes
+
+ # ==> Configuration for :lockable
+ # Defines which strategy will be used to lock an account.
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
+ # :none = No lock strategy. You should handle locking by yourself.
+ # config.lock_strategy = :failed_attempts
+
+ # Defines which strategy will be used to unlock an account.
+ # :email = Sends an unlock link to the user email
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
+ # :both = Enables both strategies
+ # :none = No unlock strategy. You should handle unlocking by yourself.
+ # config.unlock_strategy = :both
+
+ # Number of authentication tries before locking an account if lock_strategy
+ # is failed attempts.
+ # config.maximum_attempts = 20
+
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
+ # config.unlock_in = 1.hour
+
+ # ==> Configuration for :token_authenticatable
+ # Defines name of the authentication token params key
+ # config.token_authentication_key = :auth_token
+
+ # ==> Scopes configuration
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
+ # "users/sessions/new". It's turned off by default because it's slower if you
+ # are using only default views.
+ # config.scoped_views = true
+
+ # Configure the default scope given to Warden. By default it's the first
+ # devise role declared in your routes.
+ # config.default_scope = :user
+
+ # Configure sign_out behavior.
+ # By default sign_out is scoped (i.e. /users/sign_out affects only :user scope).
+ # In case of sign_out_all_scopes set to true any logout action will sign out all active scopes.
+ # config.sign_out_all_scopes = false
+
+ # ==> Navigation configuration
+ # Lists the formats that should be treated as navigational. Formats like
+ # :html, should redirect to the sign in page when the user does not have
+ # access, but formats like :xml or :json, should return 401.
+ # If you have any extra navigational formats, like :iphone or :mobile, you
+ # should add them to the navigational formats lists. Default is [:html]
+ # config.navigational_formats = [:html, :iphone]
+
+ # ==> Warden configuration
+ # If you want to use other strategies, that are not (yet) supported by Devise,
+ # you can configure them inside the config.warden block. The example below
+ # allows you to setup OAuth, using http://github.com/roman/warden_oauth
+ #
+ # config.warden do |manager|
+ # manager.oauth(:twitter) do |twitter|
+ # twitter.consumer_secret = <YOUR CONSUMER SECRET>
+ # twitter.consumer_key = <YOUR CONSUMER KEY>
+ # twitter.options :site => 'http://twitter.com'
+ # end
+ # manager.default_strategies(:scope => :user).unshift :twitter_oauth
+ # end
+end
View
39 config/locales/devise.en.yml
@@ -0,0 +1,39 @@
+en:
+ errors:
+ messages:
+ not_found: "not found"
+ already_confirmed: "was already confirmed"
+ not_locked: "was not locked"
+
+ devise:
+ failure:
+ unauthenticated: 'You need to sign in or sign up before continuing.'
+ unconfirmed: 'You have to confirm your account before continuing.'
+ locked: 'Your account is locked.'
+ invalid: 'Invalid email or password.'
+ invalid_token: 'Invalid authentication token.'
+ timeout: 'Your session expired, please sign in again to continue.'
+ inactive: 'Your account was not activated yet.'
+ sessions:
+ signed_in: 'Signed in successfully.'
+ signed_out: 'Signed out successfully.'
+ passwords:
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
+ updated: 'Your password was changed successfully. You are now signed in.'
+ confirmations:
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
+ registrations:
+ signed_up: 'You have signed up successfully. If enabled, a confirmation was sent to your e-mail.'
+ updated: 'You updated your account successfully.'
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
+ unlocks:
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
+ unlocked: 'Your account was successfully unlocked. You are now signed in.'
+ mailer:
+ confirmation_instructions:
+ subject: 'Confirmation instructions'
+ reset_password_instructions:
+ subject: 'Reset password instructions'
+ unlock_instructions:
+ subject: 'Unlock Instructions'
View
4 config/routes.rb
@@ -1,4 +1,6 @@
Coolwords::Application.routes.draw do
+ devise_for :users
+
# The priority is based upon order of creation:
# first created -> highest priority.
@@ -48,7 +50,7 @@
# You can have the root of your site routed with "root"
# just remember to delete public/index.html.
- # root :to => "welcome#index"
+ root :to => "pages#home"
# See how all your routes lay out with "rake routes"
View
12 db/migrate/20110224095226_create_words.rb
@@ -0,0 +1,12 @@
+class CreateWords < ActiveRecord::Migration
+ def self.up
+ create_table :words do |t|
+
+ t.timestamps
+ end
+ end
+
+ def self.down
+ drop_table :words
+ end
+end
View
11 db/migrate/20110224124529_add_word_and_definiton_to_words.rb
@@ -0,0 +1,11 @@
+class AddWordAndDefinitonToWords < ActiveRecord::Migration
+ def self.up
+ add_column :words, :word, :string
+ add_column :words, :definition, :text
+ end
+
+ def self.down
+ remove_column :words, :definition
+ remove_column :words, :word
+ end
+end
View
11 db/migrate/20110224134357_add_rating_and_category_to_words.rb
@@ -0,0 +1,11 @@
+class AddRatingAndCategoryToWords < ActiveRecord::Migration
+ def self.up
+ add_column :words, :rating, :smallint
+ add_column :words, :category, :string
+ end
+
+ def self.down
+ remove_column :words, :category
+ remove_column :words, :rating
+ end
+end
View
26 db/migrate/20110225180242_devise_create_users.rb
@@ -0,0 +1,26 @@
+class DeviseCreateUsers < ActiveRecord::Migration
+ def self.up
+ create_table(:users) do |t|
+ t.database_authenticatable :null => false
+ t.recoverable
+ t.rememberable
+ t.trackable
+
+ # t.confirmable
+ # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
+ # t.token_authenticatable
+
+
+ t.timestamps
+ end
+
+ add_index :users, :email, :unique => true
+ add_index :users, :reset_password_token, :unique => true
+ # add_index :users, :confirmation_token, :unique => true
+ # add_index :users, :unlock_token, :unique => true
+ end
+
+ def self.down
+ drop_table :users
+ end
+end
View
43 db/schema.rb
@@ -0,0 +1,43 @@
+# This file is auto-generated from the current state of the database. Instead
+# of editing this file, please use the migrations feature of Active Record to
+# incrementally modify your database, and then regenerate this schema definition.
+#
+# Note that this schema.rb definition is the authoritative source for your
+# database schema. If you need to create the application database on another
+# system, you should be using db:schema:load, not running all the migrations
+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
+# you'll amass, the slower it'll run and the greater likelihood for issues).
+#
+# It's strongly recommended to check this file into your version control system.
+
+ActiveRecord::Schema.define(:version => 20110225180242) do
+
+ create_table "users", :force => true do |t|
+ t.string "email", :default => "", :null => false
+ t.string "encrypted_password", :limit => 128, :default => "", :null => false
+ t.string "password_salt", :default => "", :null => false
+ t.string "reset_password_token"
+ t.string "remember_token"
+ t.datetime "remember_created_at"
+ t.integer "sign_in_count", :default => 0
+ t.datetime "current_sign_in_at"
+ t.datetime "last_sign_in_at"
+ t.string "current_sign_in_ip"
+ t.string "last_sign_in_ip"
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ end
+
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
+
+ create_table "words", :force => true do |t|
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.string "word"
+ t.text "definition"
+ t.integer "rating", :limit => 2
+ t.string "category"
+ end
+
+end
View
239 public/index.html
@@ -1,239 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Ruby on Rails: Welcome aboard</title>
- <style type="text/css" media="screen">
- body {
- margin: 0;
- margin-bottom: 25px;
- padding: 0;
- background-color: #f0f0f0;
- font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
- font-size: 13px;
- color: #333;
- }
-
- h1 {
- font-size: 28px;
- color: #000;
- }
-
- a {color: #03c}
- a:hover {
- background-color: #03c;
- color: white;
- text-decoration: none;
- }
-
-
- #page {
- background-color: #f0f0f0;
- width: 750px;
- margin: 0;
- margin-left: auto;
- margin-right: auto;
- }
-
- #content {
- float: left;
- background-color: white;
- border: 3px solid #aaa;
- border-top: none;
- padding: 25px;
- width: 500px;
- }
-
- #sidebar {
- float: right;
- width: 175px;
- }
-
- #footer {
- clear: both;
- }
-
-
- #header, #about, #getting-started {
- padding-left: 75px;
- padding-right: 30px;
- }
-
-
- #header {
- background-image: url("images/rails.png");
- background-repeat: no-repeat;
- background-position: top left;
- height: 64px;
- }
- #header h1, #header h2 {margin: 0}
- #header h2 {
- color: #888;
- font-weight: normal;
- font-size: 16px;
- }
-
-
- #about h3 {
- margin: 0;
- margin-bottom: 10px;
- font-size: 14px;
- }
-
- #about-content {
- background-color: #ffd;
- border: 1px solid #fc0;
- margin-left: -55px;
- margin-right: -10px;
- }
- #about-content table {
- margin-top: 10px;
- margin-bottom: 10px;
- font-size: 11px;
- border-collapse: collapse;
- }
- #about-content td {
- padding: 10px;
- padding-top: 3px;
- padding-bottom: 3px;
- }
- #about-content td.name {color: #555}
- #about-content td.value {color: #000}
-
- #about-content ul {
- padding: 0;
- list-style-type: none;
- }
-
- #about-content.failure {
- background-color: #fcc;
- border: 1px solid #f00;
- }
- #about-content.failure p {
- margin: 0;
- padding: 10px;
- }
-
-
- #getting-started {
- border-top: 1px solid #ccc;
- margin-top: 25px;
- padding-top: 15px;
- }
- #getting-started h1 {
- margin: 0;
- font-size: 20px;
- }
- #getting-started h2 {
- margin: 0;
- font-size: 14px;
- font-weight: normal;
- color: #333;
- margin-bottom: 25px;
- }
- #getting-started ol {
- margin-left: 0;
- padding-left: 0;
- }
- #getting-started li {
- font-size: 18px;
- color: #888;
- margin-bottom: 25px;
- }
- #getting-started li h2 {
- margin: 0;
- font-weight: normal;
- font-size: 18px;
- color: #333;
- }
- #getting-started li p {
- color: #555;
- font-size: 13px;
- }
-
-
- #sidebar ul {
- margin-left: 0;
- padding-left: 0;
- }
- #sidebar ul h3 {
- margin-top: 25px;
- font-size: 16px;
- padding-bottom: 10px;
- border-bottom: 1px solid #ccc;
- }
- #sidebar li {
- list-style-type: none;
- }
- #sidebar ul.links li {
- margin-bottom: 5px;
- }
-
- </style>
- <script type="text/javascript">
- function about() {
- info = document.getElementById('about-content');
- if (window.XMLHttpRequest)
- { xhr = new XMLHttpRequest(); }
- else
- { xhr = new ActiveXObject("Microsoft.XMLHTTP"); }
- xhr.open("GET","rails/info/properties",false);
- xhr.send("");
- info.innerHTML = xhr.responseText;
- info.style.display = 'block'
- }
- </script>
- </head>
- <body>
- <div id="page">
- <div id="sidebar">
- <ul id="sidebar-items">
- <li>
- <h3>Browse the documentation</h3>
- <ul class="links">
- <li><a href="http://api.rubyonrails.org/">Rails API</a></li>
- <li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
- <li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
- <li><a href="http://guides.rubyonrails.org/">Rails Guides</a></li>
- </ul>
- </li>
- </ul>
- </div>
-
- <div id="content">
- <div id="header">
- <h1>Welcome aboard</h1>
- <h2>You&rsquo;re riding Ruby on Rails!</h2>
- </div>
-
- <div id="about">
- <h3><a href="rails/info/properties" onclick="about(); return false">About your application&rsquo;s environment</a></h3>
- <div id="about-content" style="display: none"></div>
- </div>
-
- <div id="getting-started">
- <h1>Getting started</h1>
- <h2>Here&rsquo;s how to get rolling:</h2>
-
- <ol>
- <li>
- <h2>Use <code>rails generate</code> to create your models and controllers</h2>
- <p>To see all available options, run it without parameters.</p>
- </li>
-
- <li>
- <h2>Set up a default route and remove or rename this file</h2>
- <p>Routes are set up in config/routes.rb.</p>
- </li>
-
- <li>
- <h2>Create your database</h2>
- <p>Run <code>rake db:migrate</code> to create your database. If you're not using SQLite (the default), edit <code>config/database.yml</code> with your username and password.</p>
- </li>
- </ol>
- </div>
- </div>
-
- <div id="footer">&nbsp;</div>
- </div>
- </body>
-</html>
View
11 test/fixtures/users.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
View
11 test/fixtures/words.yml
@@ -0,0 +1,11 @@
+# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
View
8 test/functional/pages_controller_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class PagesControllerTest < ActionController::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
View
8 test/functional/words_controller_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class WordsControllerTest < ActionController::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
View
4 test/unit/helpers/pages_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class PagesHelperTest < ActionView::TestCase
+end
View
4 test/unit/helpers/words_helper_test.rb
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class WordsHelperTest < ActionView::TestCase
+end
View
8 test/unit/user_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class UserTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
View
8 test/unit/word_test.rb
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class WordTest < ActiveSupport::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
Please sign in to comment.
Something went wrong with that request. Please try again.