Download - Getting Started with Rails (3)
Getting����������� ������������������ Started����������� ������������������ (3)
2014. 11. 25 Lucius Choi(@luciuschoi)
ROR Lab. Season 4, 75th Biweekly Lecture
MVCrequest(URI)
routing
response
controller action
Cmodel
M
viewV
database
“Article”����������� ������������������ Model
articles
title string text text
“Comment”����������� ������������������ Model
comments
commenter string body text article_id integer
Resource����������� ������������������ Routing
$ rake routes Prefix Verb URI Pattern Controller#Action articles GET /articles(.:format) articles#index POST /articles(.:format) articles#create new_article GET /articles/new(.:format) articles#new edit_article GET /articles/:id/edit(.:format) articles#edit article GET /articles/:id(.:format) articles#show PATCH /articles/:id(.:format) articles#update PUT /articles/:id(.:format) articles#update DELETE /articles/:id(.:format) articles#destroy root GET / welcome#indexwelcome_index GET /welcome/index(.:format) welcome#index
Method����������� ������������������ vs����������� ������������������ Action
• public methods => “actions”
• action => render a view template or redirect
HTTP����������� ������������������ Basic����������� ������������������ Auth.
• http_basic_authenticate_with( name, password)
Live����������� ������������������ Demo
����������� ������������������ 감사합니다.