Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Display shouts

  • Loading branch information...
commit 72e42e7dae53496d92760287c03b645e6b7a0c72 1 parent dbabc39
Matthew Mongeau halogenandtoast authored
1  app/controllers/dashboards_controller.rb
View
@@ -1,5 +1,6 @@
class DashboardsController < ApplicationController
def show
@shout = Shout.new
+ @shouts = current_user.shouts
end
end
4 app/views/dashboards/show.html.erb
View
@@ -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>
3  app/views/shouts/_shout.html.erb
View
@@ -0,0 +1,3 @@
+<%= content_tag_for(:div, shout) do %>
+ <%= shout.body %>
+<% end %>
Please sign in to comment.
Something went wrong with that request. Please try again.