This project is archived and is in readonly mode.
Responder dosen't care params[:format]
-
Neeraj Singh
I get xml output when I visit http://localhost:3000/users with following code. I am using rails master.
class UsersController < ApplicationController before_filter :detect_browser def detect_browser params[:format] = 'xml' end def index @users = User.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @users } end end endCould it be that if condition is not working in your case?
-
Cedric Fung
but I use new responder syntax in rails 3
class UsersController < ApplicationController respond_to :html, :mobile def index @users = User.all respond_with(@users) end end it dosen't work with rails master -
Neeraj Singh
It's working for me with following code
class UsersController < ApplicationController respond_to :html, :xml before_filter :detect_browser def detect_browser params[:format] = 'xml' end def index @users = User.all end endI see index.html.erb if I comment out filter. With filter on I see index.xml.erb while visiting /users .
-
Cedric Fung
It won't work, my log output
this from beta3
====================================== params[:format] = xml ====================================== Processing by UsersController#index as XMLthis from rails master
Processing by UsersController#index as HTML ====================================== params[:format] = xml ======================================It just processes before params[:format]
-
José Valim
Please try to add a failing test case in Rails test suite.
-
Neeraj Singh
- State changed from new to invalid
- Importance changed from to Low
I am not able to reproduce it.
@Cedric if you are able to reproduce it then please provide information so that we can reproduce it.
I am marking it as 'invalid'. However it can be reopened later if sufficient information is provided.