Reputation: 7200
I'm trying to create a link to external website but am encountering an "Undefined method" runtime error with the code I've produced. What am I doing wrong?
show.html.erb:
<%= redirect_to "http://www.google.com", :class => "website_1" do %>
<span class="s1">
<span class="s2"><%= user.website %></span>
</span>
<% end %>
Error:
undefined method `redirect_to' for #<#:0x00000102af1808>
I've tried link_to but I thought link_to is inherited from url_to which the purpose is to utilize routes?
Thanks!
Upvotes: 1
Views: 2470
Reputation: 115521
redirect_to
is not designed to create links, you should dive into link_to
.
Upvotes: 2