- Read [Node.js, Require and Exports][rblog] and [Organize Your Code with RequireJS][rblog2]
- Fork This Gist
- Respond in your forked gist with answers to the following questions
-
In the context of Node, what is a
module
?- A module in Node from my understanding, is a function that wraps other functions and basically copies/mimics the functionality and imports it into another file in order to be used as intended.
-
##Leap My code: here
-
Responder #1 (here) - This responder took largely the same approach as me but used this.isLeap vs me using a prototype method and the indentation is different.
-
Responder #2 (here) - This responder used a single line method that seems to use all the same steps that I did but could be considered less readable.
-
Responder #3 (here) - This responder took largely the same approach as me but used an && style if statement which took off the need for one of my else ifs.
-
Responder #4 (here) - This responder took a similar approach to me but used this.isLeap and did a single line return statement.
##Leap My code: here
-
Responder #1 (here) - This responder took largely the same approach as me but used this.isLeap vs me using a prototype method and the indentation is different.
-
Responder #2 (here) - This responder used a single line method that seems to use all the same steps that I did but could be considered less readable.
-
Responder #3 (here) - This responder took largely the same approach as me but used an && style if statement which took off the need for one of my else ifs.
-
Responder #4 (here) - This responder took a similar approach to me but used this.isLeap and did a single line return statement.
rails new <project_name> -d postgresql --skip-test-unit --skip-turbolinks --skip-spring
-d postgresql
sets up the project to use PostgreSQL--skip-test-unit
skips the creation of the test directory--skip-turbolinks
&--skip-spring
creates a project that does not use turbolinks or spring
- In the Gemfile:
- inside of
group :development, :test
:gem 'rspec-rails'
bundle
rails g rspec:install
gem 'capybara
- get "/artists" artists_path
- get "/artists/42" artist_path(42)
- get "/artists/42/edit" edit_artist_path(42)
- put "/artists/42" artist_path(42)
- get "/artists/new" new_artsit_path
- post "/artists" artists_path
- delete "/artists/42" artist_path(42)
- get "/stickers" stickers_path
- get "/stickers/42" sticker_path(42)
do the thing |
What is a primary key? | |
* The id of a resource in this table. | |
What is a foreign key? | |
* The primary key from another table used as a link to find data. | |
Why would one row of data have both primary and foreign keys? | |
* If it was a join table or if the table had a one to many relationship. | |
What is Rails' convention for the column name of the primary key? | |
* id | |
What is Rails' convention for the column name of a foreign key? | |
* singular-table-name_id |