SlideShare uma empresa 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’)

Mais conteúdo relacionado

Destaque

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
 

Destaque (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
 

Semelhante 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
 

Semelhante 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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
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
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 

Ú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
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
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
 
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
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
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...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 

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’)