Skip to content

Instantly share code, notes, and snippets.

@mhfs
Created November 14, 2009 16:25
Show Gist options
  • Select an option

  • Save mhfs/234613 to your computer and use it in GitHub Desktop.

Select an option

Save mhfs/234613 to your computer and use it in GitHub Desktop.
ActionController::Routing::Routes.draw do |map|
map.devise_for :users
map.resources :users, :only => [:new, :create] do |users|
users.resources :task_lists, :controller => 'users/task_lists'
end
map.root :controller => 'homepage'
end
class Users::TaskListsController < InheritedResources::Base
defaults :route_prefix => ''
before_filter :authenticate_user!
belongs_to :user
protected
def begin_of_association_chain
@current_user
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment