- As a visitor, I want to understand what the site is offering so I can quickly orient myself
- I should see a tagline on the main page
- I should see a brief summary on the main page
- As a visitor, I want to sign up so I can save my progress and receive updates
- I should see a sign up link on the index
- I should see a form that allows me to sign up
- I should be required to provide a unique user name or email
- I should be required to provide a strong password
- I should be required to confirm my password
- I should be signed in after completing the form
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateCats < ActiveRecord::Migration | |
def change | |
create_table :cats do |t| | |
t.string :color | |
t.integer :crazy_cat_lady_id, null: false | |
t.timestamps | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CrazyCatLady < ActiveRecord::Base | |
has_many :cats, | |
inverse_of: :crazy_cat_lady | |
end | |
class Cat < ActiveRecord::Base | |
belongs_to :crazy_cat_lady, | |
inverse_of: :cats | |
validates_presence_of :crazy_cat_lady |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateWidgets < ActiveRecord::Migration | |
def change | |
create_table :widgets do |t| | |
t.string :name, null: false | |
t.string :description | |
t.boolean :flanged, default: false | |
t.timestamps | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CreateWidgets < ActiveRecord::Migration | |
def change | |
create_table :widgets do |t| | |
t.string :name, null: false | |
t.string :description | |
t.timestamps | |
end | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CrazyCatLady < ActiveRecord::Base | |
has_many :cats, | |
inverse_of: :crazy_cat_lady | |
end | |
class Cat < ActiveRecord::Base | |
belongs_to :crazy_cat_lady, | |
inverse_of: :cats | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CrazyCatLady < ActiveRecord::Base | |
has_many :cats | |
end | |
class Cat < ActiveRecord::Base | |
belongs_to :crazy_cat_lady | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def query_question_answers | |
question_answers = [] | |
i = 1 | |
begin | |
puts "Please enter a question" | |
question = gets.chomp | |
puts "Please enter the answer" | |
answer = gets.chomp | |
question_answers.push([question,answer]) | |
if i >= 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
QUESTION_ANSWERS_DEFAULT = [ | |
['What is your name?','Arthur'], | |
['What is your quest?', 'The Holy Grail'], | |
['What is the airspeed velocity of an unladen swallow?', 'African or European?'] | |
] | |
FILE_PATH = 'question_answer.txt' | |
def load_question_answers(file) | |
lines = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[mike:~/GDrive/rails_projects/atsalarm] master ± cd ~ | |
[mike:~] $ clear | |
[mike:~] $ mkdir Documents/challenge_app | |
[mike:~] $ cd Do | |
Documents/ Downloads/ dotfiles/ dotfiles_old/ | |
[mike:~] $ cd Documents/challenge_app/ | |
[mike:~/Documents/challenge_app] $ git init | |
Initialized empty Git repository in /Users/mike/Documents/challenge_app/.git/ | |
[mike:~/Documents/challenge_app] $ rails new challenge_1 | |
create |