# Can I use template to assemble a html page in an controller

**URL:** <https://www.ruby-forum.com/t/can-i-use-template-to-assemble-a-html-page-in-an-controller/105846>\
**Category:** Rails\
**Created:** [June 3, 2007, 7:28pm UTC](https://www.ruby-forum.com/t/can-i-use-template-to-assemble-a-html-page-in-an-controller/105846 "2007-06-03T19:28:38Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fanz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@fanz](https://www.ruby-forum.com/u/fanz)\
**Post date:** [June 3, 2007, 7:28pm UTC](https://www.ruby-forum.com/t/can-i-use-template-to-assemble-a-html-page-in-an-controller/105846/1 "2007-06-03T19:28:38Z")

</div>

Hi,all!  
I want to assemble a html page and put it into flash and redirect to  
another controller ,for example:

flash[:aaa]=“

hi
”

but what I need is to assemble some more complicate html page,so I  
want to read the render result of a template before to send it to  
browser.  
Any thought?  
Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![fanz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@fanz](https://www.ruby-forum.com/u/fanz)\
**Post date:** [June 3, 2007, 8:21pm UTC](https://www.ruby-forum.com/t/can-i-use-template-to-assemble-a-html-page-in-an-controller/105846/2 "2007-06-03T20:21:43Z")

</div>

chanses you going wrong directions.  
passing html through session seems unnatural  
what are you trying to accomplish?

---

<div class="post-metadata">

**Author:** ![fanz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@fanz](https://www.ruby-forum.com/u/fanz)\
**Post date:** [June 4, 2007, 1:56am UTC](https://www.ruby-forum.com/t/can-i-use-template-to-assemble-a-html-page-in-an-controller/105846/3 "2007-06-04T01:56:18Z")

</div>

On Jun 4, 2:21 am, liquidautumn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> chanses you going wrong directions.  
> passing html through session seems unnatural  
> what are you trying to accomplish?

I’m trying to redirect a urlA to urlB but finally response with the  
urlA content,like this:

request urlA: [domain.com/controller/action/](http://domain.com/controller/action/)

redirect to urlB:domain.com/#controller/action/

so then I can change the urlB as I want by js without refresh the  
page,and urlA is just for search engine

---

<div class="post-metadata">

**Author:** ![fanz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@fanz](https://www.ruby-forum.com/u/fanz)\
**Post date:** [June 4, 2007, 1:57am UTC](https://www.ruby-forum.com/t/can-i-use-template-to-assemble-a-html-page-in-an-controller/105846/4 "2007-06-04T01:57:18Z")

</div>

On Jun 4, 2:21 am, liquidautumn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> chanses you going wrong directions.  
> passing html through session seems unnatural  
> what are you trying to accomplish?

I’m trying to redirect a urlA to urlB but finally response with the  
urlA content,like this:

request urlA: [domain.com/controller/action/](http://domain.com/controller/action/)

redirect to urlB:domain.com/#controller/action/

so then I can change the urlB as I want by js without refresh the  
page,and urlA is just for search engine

---

<div class="post-metadata">

**Author:** ![fanz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@fanz](https://www.ruby-forum.com/u/fanz)\
**Post date:** [June 4, 2007, 2:36am UTC](https://www.ruby-forum.com/t/can-i-use-template-to-assemble-a-html-page-in-an-controller/105846/5 "2007-06-04T02:36:20Z")

</div>

I found the right way now:  
I can use render in the urlB place to render the urlA template

---

<div class="post-metadata">

**Author:** ![fanz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/87869e/32.png) [@fanz](https://www.ruby-forum.com/u/fanz)\
**Post date:** [June 4, 2007, 2:20am UTC](https://www.ruby-forum.com/t/can-i-use-template-to-assemble-a-html-page-in-an-controller/105846/6 "2007-06-04T02:20:19Z")

</div>

On Jun 4, 2:21 am, liquidautumn [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> chanses you going wrong directions.  
> passing html through session seems unnatural  
> what are you trying to accomplish?

I’m trying to redirect a urlA to urlB but finally response with the  
urlA content,like this:

request urlA: [domain.com/controller/action/](http://domain.com/controller/action/)

redirect to urlB:domain.com/#controller/action/

so then I can change the urlB as I want by js without refresh the  
page,and urlA is just for search engine
