Skip to content

Instantly share code, notes, and snippets.

View ltrainpr's full-sized avatar

Lionel E. Ramos ltrainpr

View GitHub Profile

Solution for Challenge: Research: View and Form Helpers. Started 2013-10-05T19:23:49+00:00

link_to

link_to is a rails helper that helps generate html link tags in views and controllers. link_to "relies on" (whatever that means) url_for - a similar (but different) helper that generates links in views and controllers. From the [ActionView docs] (http://api.rubyonrails.org/classes/ActionView/Helpers/UrlHelper.html#method-i-link_to):

link_to(name = nil, options = nil, html_options = nil, &block)

Creates a link tag of the given name using a URL created by the set of options.

=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')