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
アルテニア コンサル/ITエンジニア向け 採用ピッチ資料
altenir
0
110
個人開発で徳島大学生60%以上の心を掴んだアプリ、そして手放した話
akidon0000
1
150
意外と簡単!?フロントエンドでパスキー認証を実現する WebAuthn
teamlab
PRO
2
770
Improving my own Ruby thereafter
sisshiki1969
1
160
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
3.2k
今だからこそ入門する Server-Sent Events (SSE)
nearme_tech
PRO
3
250
AIと私たちの学習の変化を考える - Claude Codeの学習モードを例に
azukiazusa1
11
4.4k
請來的 AI Agent 同事們在寫程式時,怎麼用 pytest 去除各種幻想與盲點
keitheis
0
130
AWS発のAIエディタKiroを使ってみた
iriikeita
1
190
MCPとデザインシステムに立脚したデザインと実装の融合
yukukotani
4
1.5k
Rancher と Terraform
fufuhu
2
550
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
320
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
59
9.5k
Unsuck your backbone
ammeep
671
58k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.7k
How to Think Like a Performance Engineer
csswizardry
26
1.9k
The Pragmatic Product Professional
lauravandoore
36
6.9k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
3k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Mobile First: as difficult as doing things right
swwweet
224
9.9k
Designing Experiences People Love
moore
142
24k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Designing for humans not robots
tammielis
253
25k
Large-scale JavaScript Application Architecture
addyosmani
513
110k
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?