And if I do: http://localhost:3000/team/1.xml it shows me team 1 (not XML, but it shows me the html page) -- Posted via http://www.ruby-forum.com/.
I''ve set up my application to use edge rails in order to get REST functionality. I''ve a controller called team (team_controller.rb) with some actions (index, list, show, create, new....). Moreover in routes.rb I''ve added map.resources :team so I guess I could call localhost:3000/xxxx/team/1 or localhost:3000/xxxx/team/1;edit Well, when I do the first call, server response me ''Unknown action No action responded to 1'', surprisingly the second call shows the edit form for the team 1. Isn''t it the first call supposed to invoke ''show'' action and shows me the team 1? -- Posted via http://www.ruby-forum.com/.
On 8/11/06, Eduardo Y??ez Parareda <eduardo.yanez@gmail.com> wrote:> And if I do: > > http://localhost:3000/team/1.xml > > it shows me team 1 (not XML, but it shows me the html page) > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >For your first question, you need to just do localhost:3000/team/new etc. Not sure what that xxxx is. Also, to return XML, you need to use respond_to, i.e. def show @team = Team.find params[:id] respond_to do |type| type.html type.xml { render :xml => @team.to_xml } end end