Module | Her::Model::Paths::ClassMethods |
In: |
lib/her/model/paths.rb
|
Defines a custom collection path for the resource
@example
class User include Her::Model collection_path "/users" end
Define the primary key field that will be used to find and save records
@example
class User include Her::Model primary_key 'UserId' end
@param [Symbol] value
Defines a custom resource path for the resource
@example
class User include Her::Model resource_path "/users/:id" end
Note that, if used in combination with resource_path, you may specify either the real primary key or the string ’:id’. For example:
@example
class User include Her::Model primary_key 'user_id' # This works because we'll have a user_id attribute resource_path '/users/:user_id' # This works because we replace :id with :user_id resource_path '/users/:id' end