Project

General

Profile

Patch #5895 » user_query_api.diff

Patch - Adam Kaplan, 2010-07-16 23:04

View differences:

app/controllers/users_controller.rb (working copy)
69 69
    end
70 70
    render :layout => 'base'
71 71

  
72
    respond_to do |format|
73
      format.html
74
      format.xml
75
    end
76

  
72 77
  rescue ActiveRecord::RecordNotFound
73 78
    render_404
74 79
  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
(1-1/3)