开发者

Can i have multiple methods (post and get) allowed on an index action?

开发者 https://www.devze.com 2023-01-13 18:54 出处:网络
i would like an index action to be able to take get and post methods, is this possible and if so how?

i would like an index action to be able to take get and post methods, is this possible and if so how?

how do you write the route if in this开发者_运维知识库 case

map.resources :content, :only => [ :index ]

Many thanks


Not sure if this will work with resource routes.

map.resources :content, :only => [ :index ], :conditions => {:method => [:get, :post]}

If not you should probably just make it a named route anyhow.

map.content 'content', :controller => :content, :action => :index ,:conditions => {:method => [:get, :post]}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号