# Render a whole HTML page after an Ajax request: possible?

**URL:** <https://www.ruby-forum.com/t/render-a-whole-html-page-after-an-ajax-request-possible/171865>\
**Category:** Rails\
**Created:** [July 10, 2009, 12:36pm UTC](https://www.ruby-forum.com/t/render-a-whole-html-page-after-an-ajax-request-possible/171865 "2009-07-10T12:36:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [July 10, 2009, 12:36pm UTC](https://www.ruby-forum.com/t/render-a-whole-html-page-after-an-ajax-request-possible/171865/1 "2009-07-10T12:36:07Z")

</div>

Hi there,

Suppose: ‘action A’ was launched by an Ajax request

Question: Is it possible to

- somehow render a whole HTML page (not only return a part of the page),  
or
- redirect (within ‘action A’) to an ‘action B’ (which then could render  
a whole HTML page)

Thanks a lot!  
Tom

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [July 10, 2009, 12:48pm UTC](https://www.ruby-forum.com/t/render-a-whole-html-page-after-an-ajax-request-possible/171865/2 "2009-07-10T12:48:39Z")

</div>

> Question: Is it possible to
> 
> - somehow render a whole HTML page (not only return a part of the page),

render :update do |page|  
page.redirect\_to :action =\> ‘name’  
end

Sijo

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [July 11, 2009, 8:12am UTC](https://www.ruby-forum.com/t/render-a-whole-html-page-after-an-ajax-request-possible/171865/3 "2009-07-11T08:12:41Z")

</div>

On Fri, Jul 10, 2009 at 12:36 PM, Tom Ha  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Thanks a lot!  
> Tom

You can return an entire HTML page via ajax (Just the contents of the

 tags) and just replace that.

If you’re going to redirect, don’t bother with the Ajax

Andrew T.  
[http://ramblingsonrails.com](http://ramblingsonrails.com)

[http://MyMvelope.com](http://MyMvelope.com) - The SIMPLE way to manage your savings

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [July 10, 2009, 2:55pm UTC](https://www.ruby-forum.com/t/render-a-whole-html-page-after-an-ajax-request-possible/171865/4 "2009-07-10T14:55:13Z")

</div>

And I’d been starting to think I had to call McGyver…

Great! Thanks, Sijo!
