GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Fork of insoshi/insoshi
Description: The open source social networking platform in Ruby on Rails from the author of RailsSpace
Homepage: http://insoshi.com
Clone URL: git://github.com/andylatte/insoshi.git
Got new, index working for people
Michael Hartl (author)
Wed Feb 20 19:04:44 -0800 2008
commit  204ad3eef07c89f92bd124d3399fc746f6c8db49
tree    e1553e434f62923cf11718cc0a59a4dec52f5975
parent  841b5ea6431a060f343804e6960ed67523a10659
...
1
2
 
 
 
 
 
 
 
3
4
5
...
1
2
3
4
5
6
7
8
9
10
11
12
0
@@ -1,5 +1,12 @@
0
 class PeopleController < ApplicationController
0
   
0
+ def index
0
+ @people = Person.paginate(:all, :page => params[:page])
0
+
0
+ respond_to do |format|
0
+ format.html # index.html.erb
0
+ end
0
+ end
0
   
0
   def new
0
   end
...
1
2
 
 
 
 
 
 
 
 
 
 
 
 
 
3
...
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
0
@@ -1 +1,13 @@
0
-foo
0
\ No newline at end of file
0
+<% unless @people.empty? -%>
0
+ <%= will_paginate %>
0
+ <ul>
0
+ <%- @people.each do |person| -%>
0
+ <li><%= person.name %></li>
0
+ <%- end -%>
0
+ </ul>
0
+ <%= will_paginate %>
0
+<% else %>
0
+ <h2>No results to show.</h2>
0
+<% end -%>
0
+
0
+<div class="clear"></div>
0
\ No newline at end of file
...
21
22
23
 
 
 
24
25
...
21
22
23
24
25
26
27
28
0
@@ -21,4 +21,7 @@
0
                        :maxlength => Person::MAX_PASSWORD,
0
                        :value => "" %>
0
 </div>
0
+<div class="form_row">
0
+ <%= submit_tag 'Sign up' %>
0
+</div>
0
 <% end %>
0
\ No newline at end of file
...
35
36
37
 
 
 
 
 
38
39
40
...
35
36
37
38
39
40
41
42
43
44
45
0
@@ -35,6 +35,11 @@ describe PeopleController do
0
         response.should be_success
0
       end.should_not change(Person, :count)
0
     end
0
+
0
+ it "should have a working index" do
0
+ get :index
0
+ response.should be_success
0
+ end
0
   end
0
   
0
   describe "edit" do

Comments

    No one has commented yet.