- screenshots of scores will be posted in comments
- screenshots of completed sections will be posted in comments
class Order | |
def initialize | |
@line_items = [] | |
end | |
def add_line_item(line_item) | |
@line_items << line_item | |
end | |
def total |
This exercise is intended to help you assess your progress with the concepts and techniques we've covered during the week.
For these questions, write a short snippet of code that meets
the requirement. Fill in your answers on a second sheet of paper or in your
notebook. In cases where the question mentions a "given"
data value, use the variable given
to refer to it (instead of re-writing
the information).
Fork this gist. Answer the questions to your best ability and with limited research. No need to post your gist in the comments.
What is the purpose of the router in a Rails project?
It is like a doorman of the application that knows where to go and what action to take once HTTP request has been received.
What routes would be provided to you with the line resources :items
?
:items routes, I assume, which is probably some controller class
Because I couldn't find these with a quick Google search on 28 April 2015: | |
Usage: | |
rails new APP_PATH [options] | |
Options: | |
-r, [--ruby=PATH] # Path to the Ruby binary of your choice | |
# Default: /home/brian/.rvm/rubies/ruby-2.2.0/bin/ruby | |
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL) | |
[--skip-gemfile], [--no-skip-gemfile] # Don't create a Gemfile |
Here are 5 JavaScript exercisms, with each exercism starting with a link to my submission. In addition, 5 other solutions for each exercism are reviewed as well, with links and my comments.
My code: link to submission
I had to change div1 display to inline-block, put the other two divs into a container and floated the whole container to the right.
Set div2 margin to auto in order to center and gave absolute position to div3 with a right margin of 0.
rails new <project_name> -d postgresql --skip-turbolinks --skip-spring -T
-d postgresql
sets up the project to use PostgreSQL--skip-turbolinks
& --skip-spring
creates a project that does not use turbolinks or spring-T
skips the creation of the test directory and use of Test::Unit