0

我最近继承了一个应用程序,其中用户的编辑帐户方法以及公共帐户方法都位于同一个控制器中。我希望尝试让事情变得更像“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/accountor的路线的最佳 Rails 最佳实践是什么/user/edit/billing

4

0 回答 0