views:

35

answers:

1

Ok, I think this is probably an easy question but for the life of my I can't figure it out. I have created a table called ugtags and in that table I have two columns (beyond the basics), 'name' and 'link'.

I am trying to allow a user to add a link to a page. Ideally they would enter the link title (name) and the url (link) and in the view it would display the title as a link to the url that was entered in the link column.

I there a way to do it by simply affecting the <%= link_to h(ugtag.name) %> code?

+2  A: 

You should just be able to do:

<%= link_to h(ugtag.name), ugtag.link %>

See the documentation for all of the relevant options.

Greg Campbell
Thanks man for the quick answer. I am embarrassed that I couldn't find that link that you attached. Sorry about that. Being new to all this, not even sure how to ask the questions sometimes.
bgadoci