1
我在Rails路由中指定了以下内容。我想在这个路由上同时允许GET和POST,但无论我尝试什么,它只允许#index操作,并且在请求POST时不访问#create操作。Rails API路由问题
match ':user_id/special_deals', to: 'special_deals#index'
我已经试过这太:
match ':user_id/special_deals', to: 'special_deals#index', :via => [:get, :post]
我需要的用户ID,因为人们能够访问API可以访问多个用户的信息首先被指定。
完美!谢谢HungryCode。 – ac360 2013-04-07 06:42:44
不客气。 – HungryCoder 2013-04-07 06:46:01