Commit 6d1fd8fe
Changed files (2)
app
controllers
views
tutorials
app/controllers/tutorials_controller.rb
@@ -2,7 +2,7 @@ class TutorialsController < ApplicationController
before_filter :authenticate_user!, :except => [:show, :index]
def index
- @tutorials = Tutorial.all
+ @tutorials = Tutorial.all.reverse
end
def show
app/views/tutorials/index.html.erb
@@ -17,7 +17,7 @@
<div class="thumbnail">
<img src="<%= tutorial.image_url %>" />
<div class="caption">
- <h3><%= tutorial.heading %></h3>
+ <h3><%= tutorial.heading %> <small><%= tutorial.created_at.to_s :foomat %></small></h3>
<p><%= tutorial.description %></p>
<p><a class="btn btn-primary" href="<%= tutorial.url %>">Read</a> <a class="btn" href="<%= url_for tutorial %>">View</a></p>
</div>