pwpush 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +20 -0
  3. data/Capfile +8 -0
  4. data/Gemfile +51 -0
  5. data/Gemfile.lock +224 -0
  6. data/LICENSE.txt +674 -0
  7. data/Procfile +3 -0
  8. data/README.md +91 -0
  9. data/Rakefile +8 -0
  10. data/TODO +21 -0
  11. data/app.json +21 -0
  12. data/app/assets/flash/clippy.swf +0 -0
  13. data/app/assets/flash/github-clippy.swf +0 -0
  14. data/app/assets/images/apple-touch-icon-ipad.png +0 -0
  15. data/app/assets/images/apple-touch-icon-ipad3.png +0 -0
  16. data/app/assets/images/apple-touch-icon-iphone.png +0 -0
  17. data/app/assets/images/apple-touch-icon-iphone4.png +0 -0
  18. data/app/assets/images/black_wood.jpg +0 -0
  19. data/app/assets/images/broken_noise.png +0 -0
  20. data/app/assets/images/button_down.png +0 -0
  21. data/app/assets/images/button_over.png +0 -0
  22. data/app/assets/images/button_up.png +0 -0
  23. data/app/assets/images/concrete_wall_3.png +0 -0
  24. data/app/assets/images/favicon.ico +0 -0
  25. data/app/assets/images/forkme.png +0 -0
  26. data/app/assets/images/outlets.png +0 -0
  27. data/app/assets/images/pwpush_favicon.jpg +0 -0
  28. data/app/assets/images/pwpush_logo.png +0 -0
  29. data/app/assets/images/rails.png +0 -0
  30. data/app/assets/javascripts/api.js.coffee +4 -0
  31. data/app/assets/javascripts/application.js +52 -0
  32. data/app/assets/javascripts/errors.js.coffee +3 -0
  33. data/app/assets/javascripts/fd-slider.js +1299 -0
  34. data/app/assets/javascripts/jquery-cookie.js +117 -0
  35. data/app/assets/javascripts/jquery.noty.js +520 -0
  36. data/app/assets/javascripts/layouts/top.js +34 -0
  37. data/app/assets/javascripts/passwords.js +62 -0
  38. data/app/assets/javascripts/spoiler.js +101 -0
  39. data/app/assets/javascripts/themes/default.js +156 -0
  40. data/app/assets/stylesheets/api.css.scss +3 -0
  41. data/app/assets/stylesheets/application.css +7 -0
  42. data/app/assets/stylesheets/errors.css.scss +3 -0
  43. data/app/assets/stylesheets/fd-slider.css +650 -0
  44. data/app/assets/stylesheets/global.css.scss +52 -0
  45. data/app/assets/stylesheets/passwords.css.scss +114 -0
  46. data/app/assets/stylesheets/users.css.scss +11 -0
  47. data/app/controllers/api_controller.rb +30 -0
  48. data/app/controllers/application_controller.rb +23 -0
  49. data/app/controllers/errors_controller.rb +7 -0
  50. data/app/controllers/passwords_controller.rb +153 -0
  51. data/app/controllers/users/omniauth_callbacks_controller.rb +71 -0
  52. data/app/controllers/views_controller.rb +11 -0
  53. data/app/helpers/api_helper.rb +2 -0
  54. data/app/helpers/application_helper.rb +31 -0
  55. data/app/helpers/errors_helper.rb +2 -0
  56. data/app/helpers/passwords_helper.rb +2 -0
  57. data/app/helpers/views_helper.rb +2 -0
  58. data/app/mailers/.gitkeep +0 -0
  59. data/app/models/.gitkeep +0 -0
  60. data/app/models/password.rb +51 -0
  61. data/app/models/user.rb +20 -0
  62. data/app/models/view.rb +4 -0
  63. data/app/views/api/config.html.haml +2 -0
  64. data/app/views/api/create.html.haml +2 -0
  65. data/app/views/api/generate.html.haml +2 -0
  66. data/app/views/api/list.html.haml +2 -0
  67. data/app/views/devise/confirmations/new.html.erb +12 -0
  68. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  69. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  70. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  71. data/app/views/devise/passwords/edit.html.erb +16 -0
  72. data/app/views/devise/passwords/new.html.erb +12 -0
  73. data/app/views/devise/registrations/edit.html.erb +25 -0
  74. data/app/views/devise/registrations/new.html.haml +50 -0
  75. data/app/views/devise/sessions/new.html.haml +51 -0
  76. data/app/views/devise/shared/_links.erb +25 -0
  77. data/app/views/devise/unlocks/new.html.erb +12 -0
  78. data/app/views/errors/error_404.html.haml +21 -0
  79. data/app/views/errors/error_500.html.haml +21 -0
  80. data/app/views/layouts/_ga.html.erb +14 -0
  81. data/app/views/layouts/application.html.haml +41 -0
  82. data/app/views/pages/about.html.haml +159 -0
  83. data/app/views/passwords/edit.html.haml +7 -0
  84. data/app/views/passwords/index.html.haml +17 -0
  85. data/app/views/passwords/new.html.haml +68 -0
  86. data/app/views/passwords/show.html.haml +58 -0
  87. data/app/views/shared/_auth_providers.html.haml +9 -0
  88. data/app/views/shared/_messages.html.haml +4 -0
  89. data/app/views/views/_form.html.erb +16 -0
  90. data/app/views/views/edit.html.erb +8 -0
  91. data/app/views/views/index.html.erb +21 -0
  92. data/app/views/views/new.html.erb +5 -0
  93. data/app/views/views/show.html.erb +20 -0
  94. data/bin/bundle +13 -0
  95. data/config.ru +4 -0
  96. data/config/application.rb +51 -0
  97. data/config/boot.rb +6 -0
  98. data/config/capistrano_database_yml.rb +158 -0
  99. data/config/database.yml +19 -0
  100. data/config/deploy.rb +140 -0
  101. data/config/deploy/database.yml.erb +52 -0
  102. data/config/deploy/local_cap_config.rb.example +54 -0
  103. data/config/environment.rb +42 -0
  104. data/config/environments/development.rb +30 -0
  105. data/config/environments/engineyard.rb +60 -0
  106. data/config/environments/private.rb +60 -0
  107. data/config/environments/production.rb +60 -0
  108. data/config/environments/test.rb +39 -0
  109. data/config/initializers/backtrace_silencers.rb +7 -0
  110. data/config/initializers/devise.rb +211 -0
  111. data/config/initializers/inflections.rb +10 -0
  112. data/config/initializers/mime_types.rb +5 -0
  113. data/config/initializers/secret_token.rb +7 -0
  114. data/config/initializers/session_store.rb +8 -0
  115. data/config/initializers/wrap_parameters.rb +14 -0
  116. data/config/locales/devise.en.yml +58 -0
  117. data/config/locales/en.yml +5 -0
  118. data/config/routes.rb +16 -0
  119. data/config/unicorn.rb +22 -0
  120. data/db/migrate/20111128183630_create_passwords.rb +12 -0
  121. data/db/migrate/20111228183300_create_views.rb +16 -0
  122. data/db/migrate/20120102210558_devise_create_users.rb +54 -0
  123. data/db/migrate/20120102210559_create_rails_admin_histories_table.rb +18 -0
  124. data/db/migrate/20120102220933_add_admin_to_user.rb +9 -0
  125. data/db/migrate/20120129211750_add_lockable_to_users.rb +10 -0
  126. data/db/migrate/20120220172426_add_user_to_password.rb +11 -0
  127. data/db/migrate/20121105144421_add_deleted_to_password.rb +5 -0
  128. data/db/migrate/20150323145847_add_first_view_flag.rb +9 -0
  129. data/db/migrate/20160214205926_add_deletable_to_password.rb +5 -0
  130. data/db/schema.rb +78 -0
  131. data/db/seeds.rb +7 -0
  132. data/log/.gitkeep +0 -0
  133. data/public/404.html +26 -0
  134. data/public/422.html +26 -0
  135. data/public/500.html +26 -0
  136. data/public/favicon.ico +0 -0
  137. data/public/robots.txt +3 -0
  138. data/script/rails +6 -0
  139. metadata +226 -0
@@ -0,0 +1,10 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ PasswordPusher::Application.config.secret_token = ENV['SECRET_KEY_BASE'] || 'b7efd5d3d967b3b669d439c371329cc990616b9dd47bf02c42dedb3c74a9d54e30dfd52323480623acc92fdec88b79d2cf9e211b1fd8a946d008c4e1f3162b28'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ PasswordPusher::Application.config.session_store :cookie_store, :key => '_PasswordPusher_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # PasswordPusher::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters :format => [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,58 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ errors:
5
+ messages:
6
+ expired: "has expired, please request a new one"
7
+ not_found: "not found"
8
+ already_confirmed: "was already confirmed, please try signing in"
9
+ not_locked: "was not locked"
10
+ not_saved:
11
+ one: "1 error prohibited this %{resource} from being saved:"
12
+ other: "%{count} errors prohibited this %{resource} from being saved:"
13
+
14
+ devise:
15
+ failure:
16
+ already_authenticated: 'You are already signed in.'
17
+ unauthenticated: 'You need to sign in or sign up before continuing.'
18
+ unconfirmed: 'You have to confirm your account before continuing.'
19
+ locked: 'Your account is locked.'
20
+ invalid: 'Invalid email or password.'
21
+ invalid_token: 'Invalid authentication token.'
22
+ timeout: 'Your session expired, please sign in again to continue.'
23
+ inactive: 'Your account was not activated yet.'
24
+ sessions:
25
+ signed_in: 'Signed in successfully.'
26
+ signed_out: 'Signed out successfully.'
27
+ passwords:
28
+ send_instructions: 'You will receive an email with instructions about how to reset your password in a few minutes.'
29
+ updated: 'Your password was changed successfully. You are now signed in.'
30
+ updated_not_active: 'Your password was changed successfully.'
31
+ send_paranoid_instructions: "If your e-mail exists on our database, you will receive a password recovery link on your e-mail"
32
+ confirmations:
33
+ send_instructions: 'You will receive an email with instructions about how to confirm your account in a few minutes.'
34
+ send_paranoid_instructions: 'If your e-mail exists on our database, you will receive an email with instructions about how to confirm your account in a few minutes.'
35
+ confirmed: 'Your account was successfully confirmed. You are now signed in.'
36
+ registrations:
37
+ signed_up: 'Welcome! You have signed up successfully.'
38
+ inactive_signed_up: 'You have signed up successfully. However, we could not sign you in because your account is %{reason}.'
39
+ updated: 'You updated your account successfully.'
40
+ destroyed: 'Bye! Your account was successfully cancelled. We hope to see you again soon.'
41
+ reasons:
42
+ inactive: 'inactive'
43
+ unconfirmed: 'unconfirmed'
44
+ locked: 'locked'
45
+ unlocks:
46
+ send_instructions: 'You will receive an email with instructions about how to unlock your account in a few minutes.'
47
+ unlocked: 'Your account was successfully unlocked. You are now signed in.'
48
+ send_paranoid_instructions: 'If your account exists, you will receive an email with instructions about how to unlock it in a few minutes.'
49
+ omniauth_callbacks:
50
+ success: 'Successfully authorized from %{kind} account.'
51
+ failure: 'Could not authorize you from %{kind} because "%{reason}".'
52
+ mailer:
53
+ confirmation_instructions:
54
+ subject: 'Confirmation instructions'
55
+ reset_password_instructions:
56
+ subject: 'Reset password instructions'
57
+ unlock_instructions:
58
+ subject: 'Unlock Instructions'
@@ -0,0 +1,5 @@
1
+ # Sample localization file for English. Add more files in this directory for other locales.
2
+ # See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3
+
4
+ en:
5
+ hello: "Hello world"
@@ -0,0 +1,16 @@
1
+ PasswordPusher::Application.routes.draw do
2
+ devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
3
+
4
+ resources :p, :controller => :passwords, :as => :passwords, :except => :index
5
+
6
+ # Password Creator route
7
+ # match '/p/:url_token/:admin_key' => 'passwords#details', :via => :get, :as => :password
8
+
9
+ root :to => 'passwords#new'
10
+
11
+ match 'pages/about' => 'high_voltage/pages#show', :id => 'about'
12
+
13
+ unless Rails.application.config.consider_all_requests_local
14
+ match '*not_found', to: 'errors#error_404'
15
+ end
16
+ end
@@ -0,0 +1,22 @@
1
+ worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3)
2
+ timeout 15
3
+ preload_app true
4
+
5
+ before_fork do |server, worker|
6
+ Signal.trap 'TERM' do
7
+ puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
8
+ Process.kill 'QUIT', Process.pid
9
+ end
10
+
11
+ defined?(ActiveRecord::Base) and
12
+ ActiveRecord::Base.connection.disconnect!
13
+ end
14
+
15
+ after_fork do |server, worker|
16
+ Signal.trap 'TERM' do
17
+ puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT'
18
+ end
19
+
20
+ defined?(ActiveRecord::Base) and
21
+ ActiveRecord::Base.establish_connection
22
+ end
@@ -0,0 +1,12 @@
1
+ class CreatePasswords < ActiveRecord::Migration
2
+ def change
3
+ create_table :passwords do |t|
4
+ t.string :payload
5
+ t.integer :expire_after_days
6
+ t.integer :expire_after_views
7
+ t.boolean :expired, :default => false
8
+ t.string :url_token
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ class CreateViews < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :views do |t|
4
+ t.integer :password_id
5
+ t.string :ip
6
+ t.string :user_agent
7
+ t.string :referrer
8
+ t.boolean :successful
9
+ t.timestamps
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :views
15
+ end
16
+ end
@@ -0,0 +1,54 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table(:users) do |t|
4
+ # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
5
+ # t.token_authenticatable
6
+
7
+ ## Database authenticatable
8
+ t.string :email, :null => false, :default => ""
9
+ t.string :encrypted_password, :null => false, :default => ""
10
+
11
+ ## Recoverable
12
+ t.string :reset_password_token
13
+ t.datetime :reset_password_sent_at
14
+
15
+ ## Rememberable
16
+ t.datetime :remember_created_at
17
+
18
+ ## Trackable
19
+ t.integer :sign_in_count, :default => 0
20
+ t.datetime :current_sign_in_at
21
+ t.datetime :last_sign_in_at
22
+ t.string :current_sign_in_ip
23
+ t.string :last_sign_in_ip
24
+
25
+ ## Encryptable
26
+ # t.string :password_salt
27
+ ## Confirmable
28
+ # t.string :confirmation_token
29
+ # t.datetime :confirmed_at
30
+ # t.datetime :confirmation_sent_at
31
+ # t.string :unconfirmed_email # Only if using reconfirmable
32
+
33
+ ## Lockable
34
+ # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
35
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
36
+ # t.datetime :locked_at
37
+
38
+ # Token authenticatable
39
+ # t.string :authentication_token
40
+
41
+ ## Invitable
42
+ # t.string :invitation_token
43
+
44
+ t.timestamps
45
+ end
46
+
47
+ add_index :users, :email, :unique => true
48
+ add_index :users, :reset_password_token, :unique => true
49
+ # add_index :users, :confirmation_token, :unique => true
50
+ # add_index :users, :unlock_token, :unique => true
51
+ # add_index :users, :authentication_token, :unique => true
52
+ end
53
+
54
+ end
@@ -0,0 +1,18 @@
1
+ class CreateRailsAdminHistoriesTable < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :rails_admin_histories do |t|
4
+ t.text :message # title, name, or object_id
5
+ t.string :username
6
+ t.integer :item
7
+ t.string :table
8
+ t.integer :month, :limit => 2
9
+ t.integer :year, :limit => 5
10
+ t.timestamps
11
+ end
12
+ add_index(:rails_admin_histories, [:item, :table, :month, :year], :name => 'index_rails_admin_histories' )
13
+ end
14
+
15
+ def self.down
16
+ drop_table :rails_admin_histories
17
+ end
18
+ end
@@ -0,0 +1,9 @@
1
+ class AddAdminToUser < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :users, :admin, :boolean, :default => false
4
+ end
5
+
6
+ def self.down
7
+ remove_column :users, :admin
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ class AddLockableToUsers < ActiveRecord::Migration
2
+ def change
3
+ change_table :users do |t|
4
+ t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
5
+ t.string :unlock_token # Only if unlock strategy is :email or :both
6
+ t.datetime :locked_at
7
+ end
8
+ add_index :users, :unlock_token, :unique => true
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class AddUserToPassword < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :passwords, :user_id, :integer
4
+ add_index :passwords, :user_id
5
+ end
6
+
7
+ def self.down
8
+ remove_index :passwords, :user_id
9
+ remove_column :passwords, :user_id
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddDeletedToPassword < ActiveRecord::Migration
2
+ def change
3
+ add_column :passwords, :deleted, :boolean, :default => false
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class AddFirstViewFlag < ActiveRecord::Migration
2
+ def up
3
+ add_column :passwords, :first_view, :boolean, :default => false
4
+ end
5
+
6
+ def down
7
+ remove_column :passwords, :first_view
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddDeletableToPassword < ActiveRecord::Migration
2
+ def change
3
+ add_column :passwords, :deletable_by_viewer, :boolean, :default => true
4
+ end
5
+ end
@@ -0,0 +1,78 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20160214205926) do
15
+
16
+ create_table "passwords", :force => true do |t|
17
+ t.string "payload"
18
+ t.integer "expire_after_days"
19
+ t.integer "expire_after_views"
20
+ t.boolean "expired", :default => false
21
+ t.string "url_token"
22
+ t.datetime "created_at", :null => false
23
+ t.datetime "updated_at", :null => false
24
+ t.integer "user_id"
25
+ t.boolean "deleted", :default => false
26
+ t.boolean "first_view", :default => false
27
+ t.boolean "deletable_by_viewer"
28
+ end
29
+
30
+ add_index "passwords", ["user_id"], :name => "index_passwords_on_user_id"
31
+
32
+ create_table "rails_admin_histories", :force => true do |t|
33
+ t.text "message"
34
+ t.string "username"
35
+ t.integer "item"
36
+ t.string "table"
37
+ t.integer "month", :limit => 2
38
+ t.integer "year", :limit => 5
39
+ t.datetime "created_at", :null => false
40
+ t.datetime "updated_at", :null => false
41
+ end
42
+
43
+ add_index "rails_admin_histories", ["item", "table", "month", "year"], :name => "index_rails_admin_histories"
44
+
45
+ create_table "users", :force => true do |t|
46
+ t.string "email", :default => "", :null => false
47
+ t.string "encrypted_password", :default => "", :null => false
48
+ t.string "reset_password_token"
49
+ t.datetime "reset_password_sent_at"
50
+ t.datetime "remember_created_at"
51
+ t.integer "sign_in_count", :default => 0
52
+ t.datetime "current_sign_in_at"
53
+ t.datetime "last_sign_in_at"
54
+ t.string "current_sign_in_ip"
55
+ t.string "last_sign_in_ip"
56
+ t.datetime "created_at", :null => false
57
+ t.datetime "updated_at", :null => false
58
+ t.boolean "admin", :default => false
59
+ t.integer "failed_attempts", :default => 0
60
+ t.string "unlock_token"
61
+ t.datetime "locked_at"
62
+ end
63
+
64
+ add_index "users", ["email"], :name => "index_users_on_email", :unique => true
65
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
66
+ add_index "users", ["unlock_token"], :name => "index_users_on_unlock_token", :unique => true
67
+
68
+ create_table "views", :force => true do |t|
69
+ t.integer "password_id"
70
+ t.string "ip"
71
+ t.string "user_agent"
72
+ t.string "referrer"
73
+ t.boolean "successful"
74
+ t.datetime "created_at", :null => false
75
+ t.datetime "updated_at", :null => false
76
+ end
77
+
78
+ end
@@ -0,0 +1,7 @@
1
+ # This file should contain all the record creation needed to seed the database with its default values.
2
+ # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
+ #
4
+ # Examples:
5
+ #
6
+ # cities = City.create([{ :name => 'Chicago' }, { :name => 'Copenhagen' }])
7
+ # Mayor.create(:name => 'Emanuel', :city => cities.first)
File without changes
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -0,0 +1,26 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>