# RJS not working

**URL:** <https://discuss.rubyonrails.org/t/rjs-not-working/3535>\
**Category:** rubyonrails-talk\
**Created:** [October 24, 2006, 7:58pm UTC](https://discuss.rubyonrails.org/t/rjs-not-working/3535 "2006-10-24T19:58:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Greg\_Donald1](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/greg_donald1/32/1313_2.png) [@Greg\_Donald1](https://discuss.rubyonrails.org/u/Greg_Donald1)\
**Post date:** [October 24, 2006, 7:58pm UTC](https://discuss.rubyonrails.org/t/rjs-not-working/3535/1 "2006-10-24T19:58:47Z")

</div>

Rename it .rjs.

---

<div class="post-metadata">

**Author:** ![Michael\_Trier](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@Michael\_Trier](https://discuss.rubyonrails.org/u/Michael_Trier)\
**Post date:** [October 24, 2006, 8:57pm UTC](https://discuss.rubyonrails.org/t/rjs-not-working/3535/2 "2006-10-24T20:57:12Z")

</div>

> I don't quite understand I have an idex.rhtml, with the link to the rate controller via a link\_to\_remote and a rate.rjs file. This is correct, no?

Yes. Try this in your controller instead, and let us know:

def rate &nbsp;&nbsp;&nbsp;&nbsp;render :update do |page| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page.alert("RJS WORKS") &nbsp;&nbsp;&nbsp;&nbsp;end end

---

<div class="post-metadata">

**Author:** ![olbrich](https://sea2.discourse-cdn.com/rubyonrails/user_avatar/discuss.rubyonrails.org/olbrich/32/10820_2.png) [@olbrich](https://discuss.rubyonrails.org/u/olbrich)\
**Post date:** [October 24, 2006, 9:40pm UTC](https://discuss.rubyonrails.org/t/rjs-not-working/3535/3 "2006-10-24T21:40:56Z")

</div>

Michael Trier wrote:

> \> I don't quite understand I have an idex.rhtml, with the link \> to the rate controller via a link\_to\_remote and a rate.rjs file. \> This is correct, no?
> 
> Yes. Try this in your controller instead, and let us know:
> 
> def rate &nbsp;&nbsp;&nbsp;&nbsp;render :update do |page| &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;page.alert("RJS WORKS") &nbsp;&nbsp;&nbsp;&nbsp;end end

I prefer this style myself. RJS templates are more about logic and functionality, so it makes sense to put them in the controller. The one exception for me would be a template that I might use in several different controllers.

\_Kevin

---

<div class="post-metadata">

**Author:** ![Michael\_Trier](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@Michael\_Trier](https://discuss.rubyonrails.org/u/Michael_Trier)\
**Post date:** [October 25, 2006, 4:59pm UTC](https://discuss.rubyonrails.org/t/rjs-not-working/3535/4 "2006-10-25T16:59:45Z")

</div>

> Maybe an idea about my setup will help: I am using Apache 2.2 and Mongrel and reverse\_proxy\_fix.

Would you email me the necessary files: controller, views, helpers. I'll take a look.

Michael

---

<div class="post-metadata">

**Author:** ![Michael\_Trier](https://avatars.discourse-cdn.com/v4/letter/m/d6d6ee/32.png) [@Michael\_Trier](https://discuss.rubyonrails.org/u/Michael_Trier)\
**Post date:** [October 26, 2006, 12:29pm UTC](https://discuss.rubyonrails.org/t/rjs-not-working/3535/5 "2006-10-26T12:29:19Z")

</div>

Great.

Michael
