Link_to (rails 2.2.2)

Using Rails 2.2.2, I want to display an image that when clicked, will
take the user to an external site. I have the following code for
this:

 <%= link_to(image_tag(model.small_image), model.website_url) %>

However, when this is rendered, the URL has the path (route?) pre-
pended to it. So instead of http://www.google.com, I get
http://localhost:3000/users/12/www.google.com.

What changes do I need in order to get just http://www.google.com ?

Thanks for any help you can offer.

Hi,
Make sure that Model.website_url contains http:// - e.g. <%=
link_to(image_tag(model.small_image), “http://www.google.com”) %>

-Jazmin

On Wed, Mar 16, 2011 at 2:03 PM, srj [email protected] wrote:

What changes do I need in order to get just http://www.google.com ?
http://groups.google.com/group/rubyonrails-talk?hl=en.


Jazmin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs