Commit c18bc35f

mo k <mo@mokhan.ca>
2012-09-13 03:10:01
display saved image urls on the index page instead of using embedly api.
1 parent a202e94
Changed files (2)
app/views/tutorials/index.html.erb
@@ -1,9 +1,7 @@
 <% provide(:description, "The latest tutorials") -%>
 <% content_for :javascript do %>
 <script type="text/javascript" charset="utf-8">
-$(function(){
-    $('a.oembed').embedly({maxwidth:300});
-});
+$(function(){ });
 </script>
 <% end %>
 <div class="row-fluid">
@@ -12,7 +10,7 @@ $(function(){
     <% @tutorials.each do |tutorial| %>
       <div class="span4">
         <div class="thumbnail">
-          <a href="<%= tutorial.url %>" class="oembed"></a>
+          <img src="<%= tutorial.image_url %>" />
           <div class="caption">
             <h3><%= tutorial.heading %></h3>
             <p><%= tutorial.description %></p>
app/views/tutorials/show.html.erb
@@ -1,6 +1,9 @@
 <div class="row">
   <div class="span12">
     <h1><%= @tutorial.heading %> <small><a href="<%= @tutorial.url %>">read it</a></small></h1>
+    <% if current_user == @tutorial.user -%>
+    <%= link_to "destroy", @tutorial, :method => :delete, :confirm => "Are you sure?" %>
+    <% end -%>
     <p><%= @tutorial.description %> </p>
   </div>
 </div>