O'Reilly logo

Learning Rails: Live Edition by Edd Dumbill, Simon St. Laurent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

UrlHelper

The UrlHelper class provides methods for creating links inside of your Rails application, letting you take advantage of the routing functionality Rails uses to manage addresses. (And even though the REST world frequently talks about URIs rather than URLs, URLHelper is the place to go to create both.)

button_to

Generates a form containing a single button that links to the specified controller. (It’s the same as url_for, but wraps the result in a button.) You can ask users to confirm their interest after clicking the button.

current_page?

Returns true if the current page has the same URL as the URL created by the options listed.

link_to

Creates a link (a) element linking to the specified controller. (It’s the same as url_for, but wraps the result in an HTML link.)

link_to_if

Like link_to, but lets you specify conditions.

link_to_unless

Like link_to, but lets you specify prohibitions.

link_to_unless_current

Like link_to, but won’t link if the link is to the current page.

mail_to

Creates a mailto: link to a given email address.

url_for

Creates a URL based on the options provided and the Rails application’s routing table.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required