public
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/insoshi/insoshi.git
Search Repo:
Added 1st cut of people search to admin view
Michael Hartl (author)
Tue May 13 11:42:52 -0700 2008
commit  097957dc4fde3d04562997eb58d596fd20d09f07
tree    5bc3697a35d96e0e343df15badb1a3cb5fb69f9d
parent  ead78241e111abe139c5244eae56e041c401b38c
...
2
3
4
5
 
6
7
8
...
17
18
19
 
 
 
 
 
 
 
 
20
...
2
3
4
 
5
6
7
8
...
17
18
19
20
21
22
23
24
25
26
27
28
0
@@ -2,7 +2,7 @@
0
 
0
   def index
0
     redirect_to home_url and return if params[:model].nil?
0
- model = params[:model]
0
+ model = strip_admin(params[:model])
0
     if model == "Message"
0
       options = params.merge(:recipient => current_person)
0
     else
0
@@ -17,5 +17,13 @@
0
       @results = @results.map(&:topic).uniq.paginate
0
     end
0
   end
0
+
0
+ private
0
+
0
+ # Strip off "Admin::" from the model name.
0
+ # This is needed for, e.g., searches in the admin view
0
+ def strip_admin(model)
0
+ model.split("::").last
0
+ end
0
 end
...
1
 
2
3
4
5
6
 
7
8
 
 
 
 
 
 
 
 
 
 
 
 
...
 
1
2
 
 
 
 
3
4
 
5
6
7
8
9
10
11
12
13
14
15
16
0
@@ -1,9 +1,17 @@
0
-<%= will_paginate %>
0
+<%- column_div :type => :primary do -%>
0
 
0
-<table>
0
- <tr><th colspan="3">People</th></tr>
0
- <%= render :partial => 'person', :collection => @people %>
0
-</table>
0
+ <h2>People</h2>
0
 
0
-<%= will_paginate %>
0
+ <%= will_paginate %>
0
+
0
+ <table>
0
+ <%= render :partial => 'person', :collection => @people %>
0
+ </table>
0
+
0
+ <%= will_paginate %>
0
+<%- end -%>
0
+
0
+<%- column_div :type => :secondary do -%>
0
+ <%= render :partial => 'searches/box' %>
0
+<%- end -%>

Comments

    No one has commented yet.