我似乎不能在軌道3在Rails 3中路由:帶選項的地圖?
作爲一個具體的例子來找到映射文檔航線的選項,我需要翻譯
map.with_options :controller => 'users' do |signup|
signup.signup '/signup',
:action => 'landing',
:conditions => { :method => :get }
signup.premium '/signup/premium',
:action => 'new',
:level => 'premium',
:conditions => { :method => :get }
signup.premium '/signup/premium',
:action => 'create',
:level => 'premium',
:conditions => { :method => :post }
signup.free '/signup/free',
:action => 'new',
:level => 'free',
:conditions => { :method => :get }
signup.free '/signup/free',
:action => 'create',
:level => 'free',
:conditions => { :method => :post }
end
進了Rails3中正確的語法。我相信這一點很簡單,我忽略了,但任何幫助或鏈接到文章將是奇妙的。
我想補充一點,我需要爲這些限制添加限制,只允許免費和溢價作爲關卡的選項,但這相對來說不重要。 – 2010-07-18 00:09:19
謝謝!一直在尋找這個 – stephenmurdoch 2010-09-02 06:35:49