Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Rails routing - how to get where you want
Search
Piotr Kochowicz
October 25, 2016
Programming
0
52
Rails routing - how to get where you want
Kilka słów o routingu w Railsach. Jak jest zbudowany, czym się zajmuje i jak tworzyć routes.rb
Piotr Kochowicz
October 25, 2016
Tweet
Share
More Decks by Piotr Kochowicz
See All by Piotr Kochowicz
Pundit - Ruby on Rails Police Department
hesler
0
280
Other Decks in Programming
See All in Programming
初学者でも今すぐできる、Claude Codeの生産性を10倍上げるTips
s4yuba
15
10k
dbt民主化とLLMによる開発ブースト ~ AI Readyな分析サイクルを目指して ~
yoshyum
3
710
すべてのコンテキストを、 ユーザー価値に変える
applism118
3
1.2k
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
5
1.1k
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
2
630
設計やレビューに悩んでいるPHPerに贈る、クリーンなオブジェクト設計の指針たち
panda_program
6
1.9k
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1.2k
GitHub Copilot and GitHub Codespaces Hands-on
ymd65536
2
140
iOS 26にアップデートすると実機でのHot Reloadができない?
umigishiaoi
0
120
Azure AI Foundryではじめてのマルチエージェントワークフロー
seosoft
0
150
エンジニア向け採用ピッチ資料
inusan
0
180
猫と暮らす Google Nest Cam生活🐈 / WebRTC with Google Nest Cam
yutailang0119
0
100
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Building Applications with DynamoDB
mza
95
6.5k
Why You Should Never Use an ORM
jnunemaker
PRO
58
9.4k
Why Our Code Smells
bkeepers
PRO
337
57k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
161
15k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
Stop Working from a Prison Cell
hatefulcrawdad
270
21k
Designing Experiences People Love
moore
142
24k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
46
9.6k
Producing Creativity
orderedlist
PRO
346
40k
Transcript
Piotrek Kochowicz Rails Routing How to get where you want
Agenda ❖ Co to jest routing i co daje aplikacji
❖ Routing w Ruby on Rails ❖ Przykładowa ścieżka ❖ routes.rb ❖ Pytania
Co to jest routing?
Bibliotekarz routes.rb
routes.rb
Routing pod maską Regular Expression matching Pattern Matching (Journey gem)
Przykładowa ścieżka HTTP method URL format destination helper
Przydatne konstrukcje - Root ❖ Skrót ❖ Obsługuje tylko GET
❖ Można wykorzystać w namespace
Przydatne konstrukcje - Resource ❖ Odnosi się do konkretnego zasobu
❖ automatycznie generuje ścieżki CRUD ❖ Blok z dodatkowymi metodami: ❖ collection ❖ member
Resource nesting ❖ Ścieżki slave zawierają informacje o master ❖
Shallow skraca ścieżki do minimum
Namespace vs. Scope ❖ W każdej sekcji doda prefix admin
Namespace vs. Scope ❖ Domyślnie działa tylko na ścieżkę
Redirects ❖ Przekierowuje na nowy adres ❖ Ścieżka z przekierowania
musi być zdefiniowana
Constraints ❖ HTTP Verb ❖ Segment ❖ Request
Best practises ❖ Jedna, spójna konwencja !!! ❖ Nie produkujcie
nadmiarowych ścieżek ❖ Grupujcie ścieżki w namespaces
Dziękuję Pytania?