Browse files

Display shouts

  • Loading branch information...
1 parent dbabc39 commit 72e42e7dae53496d92760287c03b645e6b7a0c72 @halogenandtoast halogenandtoast committed Mar 12, 2012
View
1 app/controllers/dashboards_controller.rb
@@ -1,5 +1,6 @@
class DashboardsController < ApplicationController
def show
@shout = Shout.new
+ @shouts = current_user.shouts
end
end
View
4 app/views/dashboards/show.html.erb
@@ -5,3 +5,7 @@ Welcome <%= current_user.email %> - <%= link_to "Sign out", sign_out_path, metho
<%= form.text_field :body, placeholder: "Shout here" %>
<%= form.submit "Shout!" %>
<% end %>
+
+<div id="shouts">
+ <%= render @shouts %>
+</div>
View
3 app/views/shouts/_shout.html.erb
@@ -0,0 +1,3 @@
+<%= content_tag_for(:div, shout) do %>
+ <%= shout.body %>
+<% end %>

0 comments on commit 72e42e7

Please sign in to comment.