I am following a tutorial where we build a Reddit-like application. When you click on Visit URL button, it should get you to the link that the user entered (Example: Name: Stack Overflow Link: https://stackoverflow.com) instead of it going to stack overflow's website, it would be https://i-read-it-kingsong.c9users.io/links/https://www.stackoverflow.com. I am using cloud 9, ruby on rails, and I think there is a problem on my show page.
This is what it looks like:
And then here is the show page:
This is my show page:
<div class="page-header">
<h1><a href="<%= @link.url %>"><%= @link.title %></a><br> <small>Submitted by <%= @link.user.email %></small></h1>
</div>
<div class="btn-group">
<%= link_to 'Visit URL', @link.url, class: "btn btn-primary" %>
</div>
And my index page (Where I show all the links):
<% @links.each do |link| %>
<div class="link row clearfix">
<h2>
<%= link_to link.title, link %><br>
<small class="author">Submitted <%= time_ago_in_words(link.created_at) %> by <%= link.user.email %></small>
</h2>
</div>
<% end %>
Thanks for the help!