Skip to content

Instantly share code, notes, and snippets.

@ppworks
Created July 14, 2012 03:41
Show Gist options
  • Select an option

  • Save ppworks/3109082 to your computer and use it in GitHub Desktop.

Select an option

Save ppworks/3109082 to your computer and use it in GitHub Desktop.
routes for current_user
My::Application.routes.draw do
# /my scope for current_user
scope :path => :my do
resources :followings, :only => [:index, :update, :destroy], :as => :my_followings
resources :followers, :only => [:index], :as => :my_followers
resources :feeds, :only => [:index], :as => :my_feeds
resources :groups, :only => [:index], :as => :my_groups do
member do
put :entry, :action => :join
delete :entry, :action => :leave
end
end
delete '' => 'users#destroy'
root :to => 'users#show', :as => :my_root
end
end
@ppworks
Copy link
Copy Markdown
Author

ppworks commented Jul 16, 2012

scopeより見通し良くみえますね。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment