Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

users list and basic show page

  • Loading branch information...
commit 9b42834110542a3d6641193ba042393a6a136d0c 1 parent 3e2789c
@johnbender authored
View
8 app/controllers/users_controller.rb
@@ -12,4 +12,12 @@ def create
render :new
end
end
+
+ def index
+ @users = User.all
+ end
+
+ def show
+ @user = User.find(params[:id])
+ end
end
View
11 app/views/users/index.html.erb
@@ -0,0 +1,11 @@
+<% content_for :heading do %>
+ All users
+<% end %>
+
+<ul data-role="listview">
+ <% @users.each do |user| %>
+ <li>
+ <%= link_to user.email, user_path(user) %>
+ </li>
+ <% end %>
+</ul>
View
2  app/views/users/new.html.erb
@@ -5,7 +5,7 @@
<% content_for :error do %>
<% if @user.errors.any? %>
<ul>
- <% for message in @user.errors.full_messages %>
+ <% @user.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
View
1  app/views/users/show.html.erb
@@ -0,0 +1 @@
+<% content_for(:heading) { @user.email } %>
Please sign in to comment.
Something went wrong with that request. Please try again.