Module: DataMapper::Resource
- Defined in:
- lib/mack-data_mapper/resource.rb
Instance Method Summary collapse
-
#to_param ⇒ Object
Returns the key of the DataMapper::Resource object when passed into a url helper.
Instance Method Details
#to_param ⇒ Object
Returns the key of the DataMapper::Resource object when passed into a url helper
Example:
class User
include DataMapper::Resource
property :name, String, :key => true
end
users_show_url(User.new(:username => "markbates")) # => /users/markbates
12 13 14 |
# File 'lib/mack-data_mapper/resource.rb', line 12 def to_param self.key end |