acessar e realizar operações CRUD (ou um conjunto delas) Controllers de objetos Resources são implementados utilizando-se os métodos (GET, PUT, POST) defindidos no protocolo HTTP @jlucasps resources :messages namespace "admin" do resources :posts, :comments # app/controllers/admin/posts end resources :magazines do resources :ads end
index # return all messages end # GET new_message_url def new # return an HTML form for describing a new message end # POST messages_url def create # create a new message end # GET message_url(:id => 1) def show # find and return a specific message end # GET edit_message_url(:id => 1) def edit # return an HTML form for editing a specific message end # PUT message_url(:id => 1) def update # find and update a specific message end # DELETE message_url(:id => 1) def destroy # delete a specific message end end
GET /messages/new(.:format) messages#new edit_message GET /messages/:id/edit(.:format) messages#edit message GET /messages/:id(.:format) messages#show PUT /messages/:id(.:format) messages#update DELETE /messages/:id(.:format) messages#destroy