How does the model_path() method work
I'm new to ruby on rails and have been playing with some open source code in order to lear开发者_开发问答n.
I am having some issues understanding what the model_path(@model)
method returns and how to change it. Specifically, I have a model with an id
and a slug
and for some reason model_path(@model)
always returns the path with the slug
and not the id
.
Any ideas on why this may be and how I can change this behavior?
model_path(@model)
will produce this URL
/model/:id
it will substitute :id
with whatever @model.to_param
returns
精彩评论