Rails POST, PUT, GET

前端 未结 8 1337
伪装坚强ぢ
伪装坚强ぢ 2020-12-12 14:14

After I generate a scaffold, Rails gives me the ability to POST to items.xml which will create a new item. A GET to items.xml will sim

相关标签:
8条回答
  • 2020-12-12 15:07

    Did you want to know how to use POST only? Do this, for example:

    resources :items, :only => [:create]
    

    ..etc. This is for Rails 3 by the way, and will generate a single resource to POST create. Or if you only need a really small subset of the REST set, just:

    match 'items/:id' => "items#create', :via => :post
    

    etc etc.

    0 讨论(0)
  • 2020-12-12 15:11

    The best place to learn about this would be the Routing Guide.

    0 讨论(0)
提交回复
热议问题