main
 1<% content_for :javascript do %>
 2<script src="http://cdn.embed.ly/jquery.embedly-3.0.5.min.js" type="text/javascript"></script>
 3<script src="http://cdn.embed.ly/jquery.preview-0.3.2.min.js" type="text/javascript"></script>
 4<link rel="stylesheet" href="http://cdn.embed.ly/jquery.preview-0.3.2.css" />
 5<script>
 6$('#url').preview({ key:'<%= ENV['EMBEDLY_KEY']  %>' });
 7$('form').on('submit', function(){
 8  $(this).addInputs($('#url').data('preview'));
 9  return true;
10});
11</script>
12<% end %>
13
14<div class="row">
15  <div class="span12">
16    <% if user_signed_in? %>
17      <%= form_for Link.new, :url => links_path, :method => :post, :html => { :class => "form-inline" } do |f| %>
18        <input type="text" id="url" name="url" value="" placeholder="http://google.com/" />
19        <%= f.submit :add, :class => "btn" %>
20        <div class="selector-wrapper"></div>
21      <% end %>
22    <% else %>
23      <%= link_to "Add Link", new_user_session_path %>
24    <% end %>
25  </div>
26</div>
27
28<div class="row">
29  <div class="span12">
30    <table class="table">
31      <tr>
32        <th></th>
33        <th></th>
34        <th></th>
35        <th></th>
36      </tr>
37      <% @links.each do |link| %>
38        <tr>
39        <td><%= image_tag link.thumbnail_url %></td>
40        <td><%= link_to link.title, link.url %></td>
41        <td><%= link.description %></td>
42      </tr>
43    <% end %>
44    </table>
45  </div>
46</div>