Skip to content

Instantly share code, notes, and snippets.

@carllerche
Created September 26, 2008 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save carllerche/13031 to your computer and use it in GitHub Desktop.
Save carllerche/13031 to your computer and use it in GitHub Desktop.
Merb::Router.prepare do
identify User => [:account, :login] do
resources :users
end
end
# -- Generating --
url(:user, @user) # => /users/awesome-acount/my_login_name
# -- In the controller --
# -- In otherwords, #identify also sets the keys of the resource
class Users < Account
def show
params == { :account => "awesome-account", :login => "my_login_name" }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment