(new to Stack Overflow, please be gentle)
In my Rails app, which is much like Reddit, I'd like a user to be able to click on the link posted and... actually go to that link. (They'd be going to other websites, as you'd expect.) For instance, if someone posted a title with a link going to www.google.com
, someone should be able to click on the title text and, you know, go to Google.
But the error that always shows up when clicking a link is:
Routing Error
No route matches [GET] "/links/www.google.com"
(EDIT) Here is my relevant part of the Show page:
<div class="page-header">
<h1><a href="<%= @link.url %>"><%= @link.title %></a><br>
<small>Submitted by <%= @link.user.email %></small></h1>
</div>
<%= image_tag @link.image.url(:medium) %>
<br>
<br>
<div class="btn-group">
<%= link_to 'Visit URL', @link.url, class: "btn btn-primary" %>
</div>
<% if @link.user == current_user %>
<div class="btn-group">
<%= link_to 'Edit', edit_link_path(@link), class: "btn btn-default" %>
<%= link_to 'Destroy', @link, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-default" %>
</div>
<% end %>`
Does anyone know why that might be? And how to fix the issue?