# Replace rhtml view with rjs

**URL:** <https://www.ruby-forum.com/t/replace-rhtml-view-with-rjs/119432>\
**Category:** Rails\
**Created:** [November 7, 2007, 12:04am UTC](https://www.ruby-forum.com/t/replace-rhtml-view-with-rjs/119432 "2007-11-07T00:04:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 7, 2007, 12:04am UTC](https://www.ruby-forum.com/t/replace-rhtml-view-with-rjs/119432/1 "2007-11-07T00:04:17Z")

</div>

Hi,

I am following the examples in the Agile Web D. with Rails  
book and am supposed to be replacing an rhtml view with an rjs. So I  
deleted the rhtml file and replaced it with an rjs file with the same  
name. However, I now get an error saying ‘No such file  
found …rhtml’, even though it should be picking up the rjs instead.  
Can anyone let me know why this is not working correctly? Am I getting  
something wrong here? I am very new at this…

Thanks for your help,  
Andrew

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [November 7, 2007, 2:03am UTC](https://www.ruby-forum.com/t/replace-rhtml-view-with-rjs/119432/2 "2007-11-07T02:03:03Z")

</div>

My understanding is that it has to match your action name, but reside  
in your views folder, just like the rhtml file.

So - say URL is /user/edit that maps to UserController, action edit,  
then you want to provide your RJS in app/views/user/edit.rjs

Works for me 🙂

On Nov 6, 3:03 pm, “removed\_email\_address@domain.invalid”

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 18, 2008, 1:21pm UTC](https://www.ruby-forum.com/t/replace-rhtml-view-with-rjs/119432/3 "2008-02-18T13:21:56Z")

</div>

On a side note, how do you handle the need for  
app/views/controller/action.rhtml AND app/views/controller/action.rjs ?

My app needs to display an action using the rhtml for the initial  
display and using the rjs for updates (it’s a paginated list).

I am just getting my head around rjs and may be doing it wrong, however  
😉
