SlideShare una empresa de Scribd logo
1 de 21
Relearning routes in Rails Routes in Rails 3 Juliana M. de Lucena @julianalucenaa (Yes, it has two ‘a’)
“I love URLs. I dream about them at night. I think about them before I think about anything else.” Adrian Holovaty, co-creator of Django From Webstock 2009
What have changed? (From version 2 to 3) Everything Almost
Our Path Good perceptions Block declaration Let’s see some routes Root Resource Default Using constraints Redirect Namespace on route Translating Let’s MAKE some routes
Good Perceptions Concise Clean Fast In a Rubyish-way
Block Declaration Old one New one You do not need to use map anymore
Let’s see some routing Root route Old one New one Concise
Let’s see some routing Resource route Nested resources “Resources should never be nested more than 1 level deep.” Rails Guides Old one New one Clean
Let’s see some routing Resource route Adding some routes Old one New one or Rubyish
Let’s see some routing Default route Old one New one And you can name it like below It generates show_tag_type_path
Tired of showing Rails 2 examples Sorry Let’s move on without them
Let’s see some routing Using constraints On HTTP method On some fragment
Let’s see some routing Redirect route Namespace on route Admin::LibrariesController
Let’s see some routing Translating routes (it can be useful for us?)
Enough! <O> Let’s MAKE some routing You can see more surfing through the web
Let’s MAKE some routing Some advises  In a DOJO way We are interest just on routes, forget about view, models and controllers things Do not be scared with specification, it will be very simple Control your anxiety, it is on next page
Let’s MAKE some routing  Exists a library That has many books, employees and students A book Can be created, edited, updated, deleted by any employee Can be seen, borrowed and returned by everyone Is identified by a five characters code All employees Can access some library  private informationsthrough a special URL that begins with ‘admin’ Post method
Let’s MAKE some routing  The library changed the name: When somebody access /my_old_library should redirect to /my_new_library With ‘/library/branchs’ we can see all libraries physical addresses (static page) Do not forget the root path All routes should be translated to portuguese
Thank you all See u later
References Routing in Rails 3 - #203 Railscastsepisode Ruby on Rails guidesand 2.3.8 version http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/ routes.rb itself
Juliana M. de Lucena @julianalucenaa (Yes, it has two ‘a’)

Más contenido relacionado

Destacado

Lightning Talk: Kunatowski, ENX_vom automobilnetzwerk zur community-cloud
Lightning Talk: Kunatowski, ENX_vom automobilnetzwerk zur community-cloudLightning Talk: Kunatowski, ENX_vom automobilnetzwerk zur community-cloud
Lightning Talk: Kunatowski, ENX_vom automobilnetzwerk zur community-cloudCloudOps Summit
 
Introduction to adobe e learning suite no_macro
Introduction to adobe e learning suite no_macroIntroduction to adobe e learning suite no_macro
Introduction to adobe e learning suite no_macroAllen Partridge
 
Augmenting People – Steuern wir noch oder werden wir gesteuert?
Augmenting People –  Steuern wir noch oder werden wir gesteuert?Augmenting People –  Steuern wir noch oder werden wir gesteuert?
Augmenting People – Steuern wir noch oder werden wir gesteuert?CloudOps Summit
 
Social Media Analysis & Strategy - revised 1-14-14
Social Media Analysis & Strategy - revised 1-14-14Social Media Analysis & Strategy - revised 1-14-14
Social Media Analysis & Strategy - revised 1-14-14Andrea Berberich
 
Advanced SEO - Digital Content Creators
Advanced SEO - Digital Content CreatorsAdvanced SEO - Digital Content Creators
Advanced SEO - Digital Content CreatorsAndrea Berberich
 
Play as Product: How Play and Playfulness can help us build better Products a...
Play as Product: How Play and Playfulness can help us build better Products a...Play as Product: How Play and Playfulness can help us build better Products a...
Play as Product: How Play and Playfulness can help us build better Products a...Rosemary Elizabeth King
 
English assignment- andrew Townsend
English assignment- andrew TownsendEnglish assignment- andrew Townsend
English assignment- andrew Townsendbumbum007
 
Career planning
Career planningCareer planning
Career planningjaykayx23
 
Final presentation for Multimedia Class
Final presentation for Multimedia ClassFinal presentation for Multimedia Class
Final presentation for Multimedia Classlynndfreeman
 
Rob moffat balderton ignite leweb 2012 final
Rob moffat balderton ignite leweb 2012 finalRob moffat balderton ignite leweb 2012 final
Rob moffat balderton ignite leweb 2012 finalRob Moffat
 
Consumer Opinion on Electric Vehicles: Enprecis Mobility Panel
Consumer Opinion on Electric Vehicles: Enprecis Mobility PanelConsumer Opinion on Electric Vehicles: Enprecis Mobility Panel
Consumer Opinion on Electric Vehicles: Enprecis Mobility PanelEnprecis
 
Sarah branding identity
Sarah branding identity Sarah branding identity
Sarah branding identity sarahlambe
 

Destacado (16)

N5 v
N5 vN5 v
N5 v
 
Lightning Talk: Kunatowski, ENX_vom automobilnetzwerk zur community-cloud
Lightning Talk: Kunatowski, ENX_vom automobilnetzwerk zur community-cloudLightning Talk: Kunatowski, ENX_vom automobilnetzwerk zur community-cloud
Lightning Talk: Kunatowski, ENX_vom automobilnetzwerk zur community-cloud
 
Introduction to adobe e learning suite no_macro
Introduction to adobe e learning suite no_macroIntroduction to adobe e learning suite no_macro
Introduction to adobe e learning suite no_macro
 
Augmenting People – Steuern wir noch oder werden wir gesteuert?
Augmenting People –  Steuern wir noch oder werden wir gesteuert?Augmenting People –  Steuern wir noch oder werden wir gesteuert?
Augmenting People – Steuern wir noch oder werden wir gesteuert?
 
Presentación2
Presentación2Presentación2
Presentación2
 
Social Media Analysis & Strategy - revised 1-14-14
Social Media Analysis & Strategy - revised 1-14-14Social Media Analysis & Strategy - revised 1-14-14
Social Media Analysis & Strategy - revised 1-14-14
 
Advanced SEO - Digital Content Creators
Advanced SEO - Digital Content CreatorsAdvanced SEO - Digital Content Creators
Advanced SEO - Digital Content Creators
 
Play as Product: How Play and Playfulness can help us build better Products a...
Play as Product: How Play and Playfulness can help us build better Products a...Play as Product: How Play and Playfulness can help us build better Products a...
Play as Product: How Play and Playfulness can help us build better Products a...
 
2013 the year ahead
2013 the year ahead2013 the year ahead
2013 the year ahead
 
Animal types
Animal typesAnimal types
Animal types
 
English assignment- andrew Townsend
English assignment- andrew TownsendEnglish assignment- andrew Townsend
English assignment- andrew Townsend
 
Career planning
Career planningCareer planning
Career planning
 
Final presentation for Multimedia Class
Final presentation for Multimedia ClassFinal presentation for Multimedia Class
Final presentation for Multimedia Class
 
Rob moffat balderton ignite leweb 2012 final
Rob moffat balderton ignite leweb 2012 finalRob moffat balderton ignite leweb 2012 final
Rob moffat balderton ignite leweb 2012 final
 
Consumer Opinion on Electric Vehicles: Enprecis Mobility Panel
Consumer Opinion on Electric Vehicles: Enprecis Mobility PanelConsumer Opinion on Electric Vehicles: Enprecis Mobility Panel
Consumer Opinion on Electric Vehicles: Enprecis Mobility Panel
 
Sarah branding identity
Sarah branding identity Sarah branding identity
Sarah branding identity
 

Similar a Relearning routes in Rails

Getting Started with Drupal
Getting Started with DrupalGetting Started with Drupal
Getting Started with DrupalRachel Vacek
 
Laravel + Restangular Introduction
Laravel + Restangular IntroductionLaravel + Restangular Introduction
Laravel + Restangular IntroductionAndrew Del Prete
 
Summon and LibGuides in Drupal
Summon and LibGuides in DrupalSummon and LibGuides in Drupal
Summon and LibGuides in DrupalKen Varnum
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Henry S
 
REST APIs in Laravel 101
REST APIs in Laravel 101REST APIs in Laravel 101
REST APIs in Laravel 101Samantha Geitz
 
Drupal for Libraries 05/28/09
Drupal for Libraries 05/28/09Drupal for Libraries 05/28/09
Drupal for Libraries 05/28/09Mikael Jacobsen
 
The Ultimate Guide to Laravel Routing in 2023-24
The Ultimate Guide to Laravel Routing in 2023-24The Ultimate Guide to Laravel Routing in 2023-24
The Ultimate Guide to Laravel Routing in 2023-24CMARIX TechnoLabs
 

Similar a Relearning routes in Rails (7)

Getting Started with Drupal
Getting Started with DrupalGetting Started with Drupal
Getting Started with Drupal
 
Laravel + Restangular Introduction
Laravel + Restangular IntroductionLaravel + Restangular Introduction
Laravel + Restangular Introduction
 
Summon and LibGuides in Drupal
Summon and LibGuides in DrupalSummon and LibGuides in Drupal
Summon and LibGuides in Drupal
 
Learning to code for startup mvp session 3
Learning to code for startup mvp session 3Learning to code for startup mvp session 3
Learning to code for startup mvp session 3
 
REST APIs in Laravel 101
REST APIs in Laravel 101REST APIs in Laravel 101
REST APIs in Laravel 101
 
Drupal for Libraries 05/28/09
Drupal for Libraries 05/28/09Drupal for Libraries 05/28/09
Drupal for Libraries 05/28/09
 
The Ultimate Guide to Laravel Routing in 2023-24
The Ultimate Guide to Laravel Routing in 2023-24The Ultimate Guide to Laravel Routing in 2023-24
The Ultimate Guide to Laravel Routing in 2023-24
 

Último

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 

Último (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 

Relearning routes in Rails

  • 1. Relearning routes in Rails Routes in Rails 3 Juliana M. de Lucena @julianalucenaa (Yes, it has two ‘a’)
  • 2. “I love URLs. I dream about them at night. I think about them before I think about anything else.” Adrian Holovaty, co-creator of Django From Webstock 2009
  • 3. What have changed? (From version 2 to 3) Everything Almost
  • 4. Our Path Good perceptions Block declaration Let’s see some routes Root Resource Default Using constraints Redirect Namespace on route Translating Let’s MAKE some routes
  • 5. Good Perceptions Concise Clean Fast In a Rubyish-way
  • 6. Block Declaration Old one New one You do not need to use map anymore
  • 7. Let’s see some routing Root route Old one New one Concise
  • 8. Let’s see some routing Resource route Nested resources “Resources should never be nested more than 1 level deep.” Rails Guides Old one New one Clean
  • 9. Let’s see some routing Resource route Adding some routes Old one New one or Rubyish
  • 10. Let’s see some routing Default route Old one New one And you can name it like below It generates show_tag_type_path
  • 11. Tired of showing Rails 2 examples Sorry Let’s move on without them
  • 12. Let’s see some routing Using constraints On HTTP method On some fragment
  • 13. Let’s see some routing Redirect route Namespace on route Admin::LibrariesController
  • 14. Let’s see some routing Translating routes (it can be useful for us?)
  • 15. Enough! <O> Let’s MAKE some routing You can see more surfing through the web
  • 16. Let’s MAKE some routing Some advises In a DOJO way We are interest just on routes, forget about view, models and controllers things Do not be scared with specification, it will be very simple Control your anxiety, it is on next page
  • 17. Let’s MAKE some routing Exists a library That has many books, employees and students A book Can be created, edited, updated, deleted by any employee Can be seen, borrowed and returned by everyone Is identified by a five characters code All employees Can access some library private informationsthrough a special URL that begins with ‘admin’ Post method
  • 18. Let’s MAKE some routing The library changed the name: When somebody access /my_old_library should redirect to /my_new_library With ‘/library/branchs’ we can see all libraries physical addresses (static page) Do not forget the root path All routes should be translated to portuguese
  • 19. Thank you all See u later
  • 20. References Routing in Rails 3 - #203 Railscastsepisode Ruby on Rails guidesand 2.3.8 version http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/ routes.rb itself
  • 21. Juliana M. de Lucena @julianalucenaa (Yes, it has two ‘a’)