# One RHTML file

**URL:** <https://www.ruby-forum.com/t/one-rhtml-file/95408>\
**Category:** Rails\
**Created:** [May 31, 2006, 1:56pm UTC](https://www.ruby-forum.com/t/one-rhtml-file/95408 "2006-05-31T13:56:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e8c25b/32.png) [@asno](https://www.ruby-forum.com/u/asno)\
**Post date:** [May 31, 2006, 1:56pm UTC](https://www.ruby-forum.com/t/one-rhtml-file/95408/1 "2006-05-31T13:56:54Z")

</div>

I am making a simple app which has just a few screens and I would like  
to do it with a single html file.

The file has all of the difffernt componants of each screen in hidden  
div’s which I want to make visible and place as the visitor moves  
through the site.

I can see that RoR has the ability but I am not quite getting it.

The path is roughly login -\> modify account -\> submit data -\> alter data  
-\> logout

pretty straight forward.

Instead of having each of the views seperate is ther ea way to make them  
all the same and just turn on or off the needed div’s?

thanks for any input.

---

<div class="post-metadata">

**Author:** ![asno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e8c25b/32.png) [@asno](https://www.ruby-forum.com/u/asno)\
**Post date:** [May 31, 2006, 2:02pm UTC](https://www.ruby-forum.com/t/one-rhtml-file/95408/2 "2006-05-31T14:02:26Z")

</div>

I would set up a partial for each componant you need to display, then  
use ajax and rjs to update the page with the relevant partial. I think  
it’s going to get confusing later if you have too much data in a single  
view.

On Wed, 2006-05-31 at 13:56 +0200, Dave Waller wrote:

> → logout
> 
> pretty straight forward.
> 
> Instead of having each of the views seperate is ther ea way to make them  
> all the same and just turn on or off the needed div’s?
> 
> thanks for any input.

Charlie B.  
[http://www.recentrambles.com](http://www.recentrambles.com)

---

<div class="post-metadata">

**Author:** ![asno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e8c25b/32.png) [@asno](https://www.ruby-forum.com/u/asno)\
**Post date:** [May 31, 2006, 4:54pm UTC](https://www.ruby-forum.com/t/one-rhtml-file/95408/3 "2006-05-31T16:54:48Z")

</div>

Dave Waller wrote:

> I am making a simple app which has just a few screens and I would like  
> to do it with a single html file.
> 
> The file has all of the difffernt componants of each screen in hidden  
> div’s which I want to make visible and place as the visitor moves  
> through the site.
> 
> I can see that RoR has the ability but I am not quite getting it.
> 
> The path is roughly login -\> modify account -\> submit data -\> alter data  
> -\> logout
> 
> pretty straight forward.
> 
> Instead of having each of the views seperate is ther ea way to make them  
> all the same and just turn on or off the needed div’s?
> 
> thanks for any input.

Hi Dave,

What I would do is render a partial in the

 using AJAX.  
Which means you have one main html file e.g. index.rhtml that some other  
partial pages e.g. \_mod\_account.rhtml, \_alter\_data.rhtml.

---

<div class="post-metadata">

**Author:** ![asno](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e8c25b/32.png) [@asno](https://www.ruby-forum.com/u/asno)\
**Post date:** [May 31, 2006, 4:55pm UTC](https://www.ruby-forum.com/t/one-rhtml-file/95408/4 "2006-05-31T16:55:05Z")

</div>

Dave Waller wrote:

> I am making a simple app which has just a few screens and I would like  
> to do it with a single html file.
> 
> The file has all of the difffernt componants of each screen in hidden  
> div’s which I want to make visible and place as the visitor moves  
> through the site.
> 
> I can see that RoR has the ability but I am not quite getting it.
> 
> The path is roughly login -\> modify account -\> submit data -\> alter data  
> -\> logout
> 
> pretty straight forward.
> 
> Instead of having each of the views seperate is ther ea way to make them  
> all the same and just turn on or off the needed div’s?
> 
> thanks for any input.

Hi Dave,

What I would do is render a partial in the

 using AJAX.  
Which means you have one main html file e.g. index.rhtml that some other  
partial pages e.g. \_mod\_account.rhtml, \_alter\_data.rhtml.

Hope this help

Victor
