Patch #5895 » user_query_api-2.diff
app/controllers/users_controller.rb (working copy) | ||
---|---|---|
46 | 46 |
:limit => @user_pages.items_per_page, |
47 | 47 |
:offset => @user_pages.current.offset |
48 | 48 | |
49 |
render :layout => !request.xhr?
|
|
49 |
render :layout => !request.xhr? |
|
50 | 50 |
end |
51 | 51 |
|
52 | 52 |
def show |
... | ... | |
67 | 67 |
return |
68 | 68 |
end |
69 | 69 |
end |
70 |
render :layout => 'base' |
|
71 | 70 | |
71 |
respond_to do |format| |
|
72 |
format.html { |
|
73 |
render :layout => 'base' |
|
74 |
} |
|
75 |
format.xml |
|
76 |
end |
|
77 | ||
72 | 78 |
rescue ActiveRecord::RecordNotFound |
73 | 79 |
render_404 |
74 | 80 |
end |
app/views/users/index.xml.builder (revision 0) | ||
---|---|---|
1 |
xml.instruct! |
|
2 |
xml.users :type => 'array' do |
|
3 |
@users.each do |user| |
|
4 |
xml.user do |
|
5 |
xml.id user.id |
|
6 |
xml.first user.firstname |
|
7 |
xml.last user.lastname |
|
8 |
xml.login user.login |
|
9 |
xml.mail user.mail |
|
10 |
end |
|
11 |
end |
|
12 |
end |
config/routes.rb (working copy) | ||
---|---|---|
171 | 171 |
map.with_options :controller => 'users' do |users| |
172 | 172 |
users.with_options :conditions => {:method => :get} do |user_views| |
173 | 173 |
user_views.connect 'users', :action => 'index' |
174 |
user_views.connect 'users.:format', :action => 'index' |
|
174 | 175 |
user_views.connect 'users/:id', :action => 'show', :id => /\d+/ |
175 | 176 |
user_views.connect 'users/new', :action => 'add' |
176 | 177 |
user_views.connect 'users/:id/edit/:tab', :action => 'edit', :tab => nil |