69. MVC is a
Architecture
Pattern
Friday, April 29, 2011
70. Model-view-controller concept. The solid line represents a directassociation,
the dashed an indirect association (via an observer for example).
Friday, April 29, 2011
71. Rails MVC Architecture
Architecture of Ruby on Rails Framework
http://www.deknight.com/2010/06/architecture-of-ruby-on-rails-framework.html
Friday, April 29, 2011
75. ASP.Net History Active Server Pages
1.0 (IIS 3.0) 1996 12
2.0 (IIS 4.0) 1997 9
3.0 (IIS 5.0) 2000 11
HTML VBScript JavaScript
GUI
ASP.NET *.config
ASP.NET
Active Server Pages .Net
2000
2002
ASP.NET MVC
2009 4
ASP.NET MVC 2
2010 3 ASP.NET 4
ASP.NET MVC 3
2011 1 Razor
Friday, April 29, 2011
102. • rails scaffold pubs note:text
• db migration
• model
• model test
• routing
• controller
• controller view
• unit test
• helper
• helper test
• stylesheet
Friday, April 29, 2011
103. Create Sample Pubs
• rails new sample
• rails scaffold pubs note:text
• rake db:migrate
• rails server
Friday, April 29, 2011
116. • rails scaffold pubs note:text
• db migration
• model
• model test
• routing
• controller
• controller view
• unit test
• helper
• helper test
• stylesheet
Friday, April 29, 2011
121. Routes
AppName::Application.routes.draw do
end
Friday, April 29, 2011
122. Routes
AppName::Application.routes.draw do
get "hello/world"
end
#=> GET hello#world
Friday, April 29, 2011
123. Routes
AppName::Application.routes.draw do
match "hello/world"
end
#=> hello#world
Friday, April 29, 2011
124. Routes
AppName::Application.routes.draw do
get "greeting.html" => "hello#world"
end
#=> GET hello#world
Friday, April 29, 2011
125. Routes
AppName::Application.routes.draw do
resources :products
end
#=>
products GET /products(.:format)
{:action=>"index", :controller=>"products"}
POST /products(.:format)
{:action=>"create", :controller=>"products"}
new_product GET /products/new(.:format)
{:action=>"new", :controller=>"products"}
edit_product GET /products/:id/edit(.:format)
{:action=>"edit", :controller=>"products"}
product GET /products/:id(.:format)
{:action=>"show", :controller=>"products"}
PUT /products/:id(.:format)
{:action=>"update", :controller=>"products"}
DELETE /products/:id(.:format)
{:action=>"destroy", :controller=>"products"}
Friday, April 29, 2011
126. Routes
AppName::Application.routes.draw do
root :to => "welcome#index"
end
#=> .
Friday, April 29, 2011
127. Routes
AppName::Application.routes.draw do
match ':controller(/:action(/:id(.:format)))'
end
#=> /action/id
Friday, April 29, 2011
128. The Goal
• Could create a simple
Rails app
Friday, April 29, 2011
129. !Rails3(1)
http://tatsu-zine.com/books/rails3
Ruby Windows
http://tatsu-zine.com/books/winrubybuild
Friday, April 29, 2011
130. Rails
IT
2011/2/24
http://www.atmarkit.co.jp/fcoding/rails/articles/
resources/01/resources01a.html
github_explore
http://www.flickr.com/photos/franck_/4456914448/
sizes/l/in/photostream/
Introducing Rails 3
http://rubyonrails.org/screencasts/rails3
Friday, April 29, 2011