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:
Got admin people search mostly working
Michael Hartl (author)
Tue May 13 11:51:24 -0700 2008
commit  a8f510af0b93d7a08d4ffdd561fd008bd1ded6ad
tree    98bc0b7ac2403e9fe6a4639760bc5514914ad037
parent  097957dc4fde3d04562997eb58d596fd20d09f07
...
18
19
20
21
 
 
22
23
24
25
26
27
 
28
 
 
 
 
 
 
29
...
18
19
20
 
21
22
23
24
25
26
27
 
28
29
30
31
32
33
34
35
36
0
@@ -18,13 +18,20 @@
0
   end
0
   
0
   # Return the partial (including path) for the given object.
0
- # partial can also accept an array of objects.
0
+ # partial can also accept an array of objects (of the same type).
0
+
0
   def partial(object)
0
     object = object.first if object.is_a?(Array)
0
     klass = object.class.to_s
0
     dir = klass.tableize # E.g., 'Person' becomes 'people'
0
     part = dir.singularize # E.g., 'people' becomes 'person'
0
- "#{dir}/#{part}"
0
+ admin_search? ? "admin/#{dir}/#{part}" : "#{dir}/#{part}"
0
   end
0
+
0
+ private
0
+
0
+ def admin_search?
0
+ params[:model] =~ /Admin/
0
+ end
0
 end

Comments

    No one has commented yet.