Tuesday, March 23, 2010

[Rails] Re: redirection in format.json ...

in my controller the create action is :

respond_to do |format|
if @request.save
flash[:notice] = 'Request was successfully created.'
format.html { redirect_to requests_url }
format.xml { render :xml => @request, :status => :created,
:location => @request }
format.json { render :json => {:result => 'success', :redirect
=> requests_url } }
format.js
else
.....

once the request is saved, ... I get in the log

Completed in 563ms (View: 1, DB: 5) | 200 OK [http://localhost/requests]

I should have
200 OK [http://localhost:3000/requests]
--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate