Rails 3路由和命名空间

时间:2013-05-23 15:24:44

标签: ruby-on-rails-3 routes

我最近继承了一个应用程序,其中用户的编辑帐户方法和公共帐户方法都存在于同一个控制器中。我希望尝试使用更多“Rails-esque”来清理应用程序。

以下是当前路线

resources :user, :only => [:update, :show] do
    member do
      get :edit_account
      put :edit_account
      put :update_billing_information
      put :update_account_type
      get :edit_vitals
      get :edit_videos
      get :edit_athletic
      get :edit_academic
      get :edit_social
      get :edit_news
      get :edit_contributors
      get :edit_primary_sport_positions
      get :edit_primary_sport
      get :edit_primary_sport_highlights
      delete :remove_alternate_position
      get :vitals
      get :videos
      get :athletic
      get :academic
      get :social
      get :news
      post :keep
      post :draft
      get :share
      post :share
      get :notes
      post :notes
      get :contact
      post :contact
      post :cut
      delete :deactivate_account
      delete :delete_authorization
    end

    get :change_current_sport, on: :collection
  end

我认为我正在寻找的是什么,最好的轨道最佳做法是将其转移到类似/user/edit/account/user/edit/billing的路线?

0 个答案:

没有答案