test_to_param

test_to_param()
Instance Public methods

Responds to to_param

Returns a string representing the object's key suitable for use in URLs or nil if model.persisted? is false.

Implementers can decide to either raise an exception or provide a default in case the record uses a composite primary key. There are no tests for this behavior in lint because it doesn't make sense to force any of the possible implementation strategies on the implementer. However, if the resource is not persisted?, then to_param should always return nil.

doc_ruby_on_rails
2015-06-20 00:00:00
Comments
Leave a Comment

Please login to continue.