Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- `app/views/links/show.html.erb`:
- ```html
- <p id="notice"><%= notice %></p>
- <h3><%= link_to @link.title, @link.url %></h3>
- <p> Submited <%= time_ago_in_words(@link.created_at) %> ago by <b><%= @link.user.email %></b></p>
- <hr/>
- <div class="button-group float-left">
- <%= link_to "Visit URL", @link.url, class: "btn btn-primary" %>
- <%= link_to 'Back', links_path, class: "btn btn-primary" %>
- </div>
- <div class="button-group float-right">
- <% if @link.user == current_user %>
- <%= link_to 'Edit', edit_link_path(@link), class: "btn btn-warning" %>
- <%= link_to 'Destroy', @link, method: :delete, data: { confirm: 'Are you sure?' }, class: "btn btn-danger" %>
- <% end %>
- </div>
- ```
Add Comment
Please, Sign In to add comment