π£οΈ 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)