代码之家  ›  专栏  ›  技术社区  ›  Dex

Rails 3自定义路由参数

  •  1
  • Dex  · 技术社区  · 14 年前

    我想要这样的东西在我的路线。这一点都不正确,但有点像这样:

    match '/:scope/authenticate' => '%{:scope}_authentication#create'
    

    在Rails3中,最好的方法是什么?

    1 回复  |  直到 14 年前
        1
  •  2
  •   Chowlett    14 年前

    我没做过什么,但这行吗?

    resources :users_authenticate
    resources :things_authenticate
    resources :admins_authenticate
    match "/:scope/authenticate" => redirect("%{scope}_authenticate/create")