Your SlideShare is downloading. ×
0
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Routing 1, Season 1
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Routing 1, Season 1

1,352

Published on

The 13th Round of ROR Lab.

The 13th Round of ROR Lab.

Published in: Technology, Design
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,352
On Slideshare
0
From Embeds
0
Number of Embeds
6
Actions
Shares
0
Downloads
4
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript

    • 1. The 13th Round of ROR Lab. Rails Routingfrom the Outside In (1) May 26th, 2012 Hyoseong Choi ROR Lab.
    • 2. Rails Router http://blog.org _path _url A Controller Action ROR Lab.
    • 3. $ rake routes posts GET /posts(.:format) posts#index POST /posts(.:format) posts#create new_post GET /posts/new(.:format) posts#newedit_post GET /posts/:id/edit(.:format) posts#edit post GET /posts/:id(.:format) posts#show PUT /posts/:id(.:format) posts#update DELETE /posts/:id(.:format) posts#destroy ROR Lab.
    • 4. An Incoming Request GET /posts/17 ? ROR Lab.
    • 5. Generating paths & URLs@patient = Patient.find(17)<%= link_to "Patient Record", patient_path(@patient) %> URL = host + port + PATH ROR Lab.
    • 6. Resource Routing• Action 7 brothers• index / show / new / edit create / update / destroy in config/routes.rb resources :photos“sine” - show, index, new, edit ROR Lab.
    • 7. An Incoming Request DELETE /posts/17 ? ROR Lab.
    • 8. HTTP verbs new create C • POST R • GET index showURL • PUT update U • DELETE destroy DNote : routing orders ROR Lab.
    • 9. Multiple Resources resources :photos resources :books resources :videos resources :photos, :books, :videos ROR Lab.
    • 10. Singular Resources match "profile" => "users#show" resource :geocoder ROR Lab.
    • 11. Singular Resources resource :geocoder Action 6 brothers no index action ROR Lab.
    • 12. Controller NamespacingAdmin:: module prefix namespace :admin do   resources :posts, :comments scope :module => "admin" do   resources :posts, :comments scope "/admin" do   resources :posts, :comments ROR Lab.
    • 13. Controller Namespacingnamespace :admin do  resources :posts, :comments Admin:: module prefix ROR Lab.
    • 14. Controller Namespacingscope :module => "admin" do  resources :posts, :comments Admin:: module prefix ROR Lab.
    • 15. Controller Namespacingscope "/admin" do  resources :posts, :comments without Admin:: module prefix ROR Lab.
    • 16. Nested Resources class Magazine < ActiveRecord::Base   has_many :ads end   class Ad < ActiveRecord::Base   belongs_to :magazine resources :magazines do   resources :ads ROR Lab.
    • 17. Nested Resources resources :magazines do   resources :ads ROR Lab.
    • 18. Paths & URLs From Objects<%= link_to "Ad details", magazine_ad_path(@magazine, @ad) %><%= link_to "Ad details", url_for([@magazine, @ad]) %><%= link_to "Ad details", [@magazine, @ad] %> ROR Lab.
    • 19. More RESTful Actions• Member Routes resources :photos do   member do     get preview   end URL : /photos/1/preview with GET Named Routes : preview_photo_url and preview_photo_path ROR Lab.
    • 20. More RESTful Actions• Collection Routes resources :photos do   collection do     get search   end URL : /photos/search with GET Named Routes : search_photos_url and search_photos_path ROR Lab.
    • 21. 감사합니다.
    • 22.   ROR Lab.

    ×