Answers

Question and Answer:

  Home  Ruby on Rails Developer

⟩ Tell us what is the purpose of the resources method in the code snippet below?

resources :posts do

member do

get ‘messages’

end

collection do

post ‘bulk_upload'

end

end

Defining routes with the “resources” method automatically generates routes for the seven standard RESTful actions:

☛ GET /messages

☛ POST /messages

☛ GET /messages/new

☛ GET /messages/:id/edit

☛ GET /messages/:id

☛ PATCH/PUT /messages/:id

☛ DELETE /messages/:id

 191 views

More Questions for you: