Permalink
Browse files

Added shouts#show

  • Loading branch information...
1 parent b01b4c3 commit e5187eddb9119b0828bb2ad0824b409c40a361dd @halogenandtoast halogenandtoast committed Mar 12, 2012
@@ -1,4 +1,8 @@
class ShoutsController < ApplicationController
+ def show
+ @shout = Shout.find(params[:id])
+ end
+
def create
shout = current_user.shouts.new(params[:shout])
shout.save
@@ -1,3 +1,3 @@
<%= content_tag_for(:div, shout) do %>
- <%= shout.body %> <%= time_ago_in_words(shout.created_at) %> ago
+ <%= link_to shout.body, shout %> <%= time_ago_in_words(shout.created_at) %> ago
<% end %>
@@ -0,0 +1,2 @@
+<%= link_to "Back", :back %>
+<%= render @shout %>
View
@@ -1,5 +1,5 @@
Shouter::Application.routes.draw do
root to: "welcome#index"
resource :dashboard, only: [:show]
- resources :shouts, only: [:create]
+ resources :shouts, only: [:create, :show]
end

0 comments on commit e5187ed

Please sign in to comment.