开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜