Rails POST, PUT, GET

前端 未结 8 1367
伪装坚强ぢ
伪装坚强ぢ 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:06

    This will help a lot, but it's not a direct answer to your question. The following command will list the mappings your app uses so you don't have to remember all the details or guess.

    $ rake routes
    

    To answer more directly, this is a convention that rails uses. You set this mapping up when you put something like the following in your routes.rb

    map.resources :items
    

提交回复
热议问题