开发者

hyperlink in ruby on rails

This is something probab开发者_C百科ly trivial but i can't quite find my way round it:

How do i add a hyperlink from one ruby-file.html.erb to another please?


Ruby uses something called routes. You can create named routes for some operations or you can use resource routes (autogenerated CRUD per resource).

For example if you have route for a model called Car, then calling

link_to "Edit my car", edit_car_path(@car)

in your view will generate a link.

remember that your are linking to a controller action in model/view/controller and not to pages

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜