Found how to do it.
window.location.replace( url-to-go ); in the template. Was looking to
do this inside the controller but this works too.
Thanks!
On 28 jul, 11:30, A. Fernández
<antoniofernandezv...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi all,
>
> I have a form that uses ajax to add a product to a cart. After all
> verifications it must redirect to the product page again.
>
> When I call the js, it makes all the verifications, if one fails, it
> renders them in a specific div with the explanation, but if there are
> no errors, it must redirect to the product again, so I used the
> typical:
>
> redirect_to @product
>
> but since it was a js call the redirect tryes to render the js
> template for @product but it not exists since it''s only html.
>
> So, ¿how can I tell redirect_to to render the html format instead of
> the js format on the redirection?
>
> So many thanks in advance.
>
> Antonio
>
> Sorry if my English it''s not good enough, I try my best :)
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
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.