Rails [结贴] 怎么能在 controller filter 里面得到当前 controller 的 index path

tsinghan · December 15, 2013 · Last by TsingHan replied at December 15, 2013 · 1909 hits

RT,我想在 ApplicationController 写一个 filter,在这里面动态得到当前 controller 的 index action 的路由。有神马办法?

明白了 可以这样 url_for(:action => 'index', :controller => controller_name, :only_path => true)

You need to Sign in before reply, if you don't have an account, please Sign up first.