rubyonrailsin

A Ruby and Rails talk

Tuesday, March 23, 2010


[Rails] redirection in format.json ...

by rubyonrailsin 0 comments

Tag


Share this post:
Design Float
StumbleUpon
Reddit

I have presently a render :json which modify the current page

if @request.save
format.html { redirect_to(@request) }
format.json { render :json => { :result => 'success', :request
=> request_path(@request) } }
....

but I would like rather to redirect to an index page
I wrote this but it doesn't redirect ...

format.json { redirect_to requests_url }

what should I write to redirect correctly to an html page ?

thanks for your help

erwin

--
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.

No comments:

Post a Comment

Subscribe feeds via e-mail

Blog Archive