Try your best to answer each question on your own before looking up the answer online. Once you're done writing your first answer, you can google the question and write the best answer you find.
3. Using the information given, complete the steps for creating a new view in a rails app by filling in the blanks:
- Create a route:
code:
get '/about' => 'statics#about'
file: config/routes
- Create the ____________
code:
class ____________ < ApplicationController
def about
_______________________
end
file: _____________________
- Create the View
code:
<div>This is the About page!</div>
file: _____________________
4. Look at these sets of Rails routes, they are an example of which principle/term that we touched on briefly in class? Find the term, and explain why it is important.
/users/ method="GET" # :controller => 'users', :action => 'index'
/users/1 method="GET" # :controller => 'users', :action => 'show'
/users/new method="GET" # :controller => 'users', :action => 'new'
/users/ method="POST" # :controller => 'users', :action => 'create'
/users/1/edit method="GET" # :controller => 'users', :action => 'edit'
/users/1 method="PUT" # :controller => 'users', :action => 'update'
/users/1 method="DELETE" # :controller => 'users', :action => 'destroy'