Upgrade to Pro — share decks privately, control downloads, hide ads and more …

REST: Code Retreat Universidad Simón Bolívar

REST: Code Retreat Universidad Simón Bolívar

Ivan Acosta-Rubio

January 06, 2012
Tweet

More Decks by Ivan Acosta-Rubio

Other Decks in Technology

Transcript

  1. # config/routes.rb resources :pagos HTTP Ruta Accion Uso get /pagos

    index todos los pagos get /pagos/new new html - crear post /pagos create crea una nueva get /pagos/:id show muestra get /pagos/:id/edit edit html - editar put /pagos/:id update actualiza delete /pagos/:id destroy borra Friday, January 6, 12
  2. # config/routes.rb | Solo Algunas acciones resources :pagos, :only =>

    [:index, :show] HTTP Ruta Accion Uso get /pagos index todos los pagos get /pagos/:id show muestra Friday, January 6, 12
  3. # config/routes.rb | Restringiendo parametros resources :pagos, :constraints => {:id

    => /[A-Z][A-Z][0-9]+/} constraints(:id => /[A-Z][A-Z][0-9]+/) do resources :pagos resources :facturas end Friday, January 6, 12
  4. # config/routes.rb | ámbito scope ":usuario" do resources :pagos end

    # app/controllers/pagos_controller.rb ... def index render :text => params[:usuario] end ... Friday, January 6, 12
  5. Interfaz uniforme Identification de recursos Manipulacion de recursos Hipermedia como

    el motor del estado de la aplicacion Mensajes descriptivos 4 Friday, January 6, 12
  6. Roy Thomas Fielding Architectural Styles and the Design of Network-based

    Software Architectures http://bit.ly/restcoderetreat Friday, January 6, 12