Skip to content

Instantly share code, notes, and snippets.

@schneems
Created July 3, 2012 00:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 5 You must be signed in to fork a gist
  • Save schneems/3036609 to your computer and use it in GitHub Desktop.
Save schneems/3036609 to your computer and use it in GitHub Desktop.
Databases and Rails Recap Quiz for Week 3
## Week 3 Quiz
## 1) What does ERB stand for?
## 2) What is the name of the place (library) where additional built in Ruby functions can be accessed?
## 3) Name 3 Reasons to use Version Control.
## 4) Name one version control software.
## 5) What is the output of this Ruby code?
arry = ['Harry Potter', 'Hunger Games', 'Cat in the Hat']
arry.each do |x|
puts "I enjoy reading #{x}"
end
## 6) What is the output of this ruby code?
richard = User.create(:name => 'richard', :movie => 'zoolander')
chris = User.create(:name => 'chris', :movie => 'sandlot')
ruby = User.create(:name => 'ruby', :movie => 'princess bride')
user_array = [richard, ruby, chris]
user_array.each do |user|
puts "#{user.name} loves watching #{user.movie}"
end
### Hint
puts chris.name
# => 'chris'
puts chris.movie
# => 'sandlot'
## 7) Once we've modified and saved a file that is under version control what 3 steps do we need to get our changes on to our origin server?
## 8) In the exercise we did for homework last week, you entered in a url similar to `http://localhost:8000/index` into your browser. Once the server got the request, explain what needed to happen in order for you to view the web page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment