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

H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Último (20)

H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
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
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

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