Skip to content

Instantly share code, notes, and snippets.

@bguthrie
Created March 17, 2009 01:08
Show Gist options
  • Save bguthrie/80215 to your computer and use it in GitHub Desktop.
Save bguthrie/80215 to your computer and use it in GitHub Desktop.
class UsersController < ResourceFull::Base
identified_by :username, :unless => lambda { |id| id =~ /^[0-9]+$/ }
queryable_with :city, :state, :from => :address
queryable_with :name, :columns => [:first_name, :last_name]
queryable_with :email_address, :fuzzy => true
queryable_with :is_active, :scope => :active
orderable_by :city, :from => :address
responds_to :html
responds_to :xml, :only => [:read, :update]
end
class AddressesController < ResourceFull::Base
nests_within :users
queryable_with :city, :state
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment