Two link Questions


I want a user to be able to submit a link to an outside website. If it
is an article titled say “Lakers lose to Denver.” from the New York
Times, I want to create a link to the article, but have the title of the
button be the name of the article.

Also I want to include the source website, but have it not be a button.
If the user submits a link that says, I want this to be shorted
automatically to


I have the information stored in a table called articles. The title is
under “title” and the url under “url”

I can use the auto_link method with url, for example:
<%= auto_link @article.url %>

I want the button to say the title field, but link to the url field.
I thought it might be something like <%= auto_link ‘title’, ‘url’ %>
But I guess I need to write some kind of helper method, which is where I
am confused.


Just <%= link_to title, url %> greetings, mike

2009/5/26, Sean S. removed_email_address@domain.invalid:

am confused.

Posted via

Von meinen Mobilgerät aus gesendet


If I try this: <%= link_to(@article.title, @article.url) %>
I almost get it. Say the title is “google” and the url is; I get a button that says google, but it links to
localhost:articles/1/, not