Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- HASH
- driver =
- {
- :name => "Happy",
- :id_number => "12345"
- }
- my_hash =
- {
- :name => "Car",
- :color => "red",
- :numwheels => 4,
- driver: driver # if colon is on the right hand side, it passes driver value
- }
- puts my_hash[:name],
- puts my_hash[:color],
- puts my_hash[num_wheels => 4
- puts my_hash[:driver][:name] # trying to get key name from my_hash, from driver
- my_hash.each do |item|
- puts item
- my_hase.each_pair do |key, value|
- puts "#{key}; #{value}"
- Model - data
- View - interface
- Controller - flow of data/dictates where to go
- User interacts with framework. Whatever you put in VIEW doesnt say where the user has to go, controller does that.
- First entry point should be the controller component.
- User will request
- a) url
- b) data/hash
- RESPONSE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement