💎 Ruby on Rails
Beginner
What are the 7 RESTful actions in Rails?
Answer
When you declare resources :posts, Rails generates 7 RESTful routes/actions: index (GET /posts — list all), show (GET /posts/:id — show one), new (GET /posts/new — render form for new), create (POST /posts — save new), edit (GET /posts/:id/edit — render edit form), update (PATCH/PUT /posts/:id — save changes), and destroy (DELETE /posts/:id — delete). These map directly to CRUD operations and form the backbone of RESTful API design in Rails.