π£οΈ Part 6 β Routing in Rails: Connect URLs to Actions
Define routes in config/routes.rb:
resources :posts
This creates CRUD routes:
-
GET /postsβ index -
GET /posts/:idβ show -
POST /postsβ create -
PATCH /posts/:idβ update -
DELETE /posts/:idβ destroy
Custom routes:
get '/about', to: 'pages#about'
Top comments (0)