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

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI AgeCprime
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...AliaaTarek5
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 

Último (20)

The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
A Framework for Development in the AI Age
A Framework for Development in the AI AgeA Framework for Development in the AI Age
A Framework for Development in the AI Age
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
(How to Program) Paul Deitel, Harvey Deitel-Java How to Program, Early Object...
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 

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