# RJS is not loaded

**URL:** <https://www.ruby-forum.com/t/rjs-is-not-loaded/149796>\
**Category:** Rails\
**Created:** [September 29, 2008, 10:31pm UTC](https://www.ruby-forum.com/t/rjs-is-not-loaded/149796 "2008-09-29T22:31:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mcrj45](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@mcrj45](https://www.ruby-forum.com/u/mcrj45)\
**Post date:** [September 29, 2008, 10:31pm UTC](https://www.ruby-forum.com/t/rjs-is-not-loaded/149796/1 "2008-09-29T22:31:55Z")

</div>

Hello,  
I have here an issue which is really critical for me (it for my  
university work and I would like to not delete this feature). It based  
on a Rails 1.x tutorial which I use now under Rails 2.x. It contains the  
refreshment (adding content or records) of an div via RJS/JS.

I access the RJS via (Controller):  
respond\_to do |format|  
format.html { redirect\_to :controller =\> ‘pattern’, :action =\> ‘show’,  
:id =\> @comment.pattern\_id }  
format.js

but the RJS is not startet.

The rjs contains:  
page.insert\_html :bottom, :comment, :partial =\> ‘list’, :object =\>  
@comment  
page[:comment\_form].reset  
page.replace\_html :notice, flash[:notice]  
flash.discard

Non of the listed action is done :(. What could be the reason for this?  
I really apprechiate each kind of help, hints etc 🙂 Thank you!!!  
Cheers,  
Knut

---

<div class="post-metadata">

**Author:** ![mcrj45](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@mcrj45](https://www.ruby-forum.com/u/mcrj45)\
**Post date:** [September 29, 2008, 10:55pm UTC](https://www.ruby-forum.com/t/rjs-is-not-loaded/149796/2 "2008-09-29T22:55:22Z")

</div>

Knut L. wrote:

> Non of the listed action is done :(. What could be the reason for this?  
> I really apprechiate each kind of help, hints etc 🙂 Thank you!!!  
> Cheers,  
> Knut

Is your log file giving any hints as to what is happening, such as  
method missing, etc?

---

<div class="post-metadata">

**Author:** ![mcrj45](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@mcrj45](https://www.ruby-forum.com/u/mcrj45)\
**Post date:** [September 29, 2008, 11:12pm UTC](https://www.ruby-forum.com/t/rjs-is-not-loaded/149796/3 "2008-09-29T23:12:26Z")

</div>

Shandy N. wrote:

> Is your log file giving any hints as to what is happening, such as  
> method missing, etc?

Hi Shandy,  
my logs are looking ok (from my point of view):  
Processing CommentController#createajax (for 127.0.0.1 at 2008-09-29  
16:39:42) [POST]  
Session ID:  
BAh7BzoMdXNlcl9pZGkGIgpmbGFzaElDOidBY3Rpb25Db250cm9sbGVyOjpG%0AbGFzaDo6Rmxhc2hIYXNoewY6C25vdGljZSIiRGFua2UgZiZ1dW1sO3IgZGVp%0AbiBLb21tZW50YXIGOgpAdXNlZHsGOwdU–4b42026f66637b18e87df4ece046484c53bb9672  
Parameters: {“commit”=\>“Eintragen”, “action”=\>“createajax”,  
“controller”=\>“comment”, “comment”=\>{“name”=\>“Knut L.”,  
“pattern\_id”=\>“2”, “user\_id”=\>“1”, “comment”=\>“kllklk”}}  
e[4;36;1mUser Columns (0.007000)e[0m e[0;1mSHOW FIELDS FROM  
`users`e[0m  
e[4;35;1mUser Load (0.003000)e[0m e[0mSELECT \* FROM `users` WHERE  
(`users`.`id` = 1) LIMIT 1e[0m  
e[4;36;1mComment Columns (0.006000)e[0m e[0;1mSHOW FIELDS FROM  
`comments`e[0m  
e[4;35;1mSQL (0.002000)e[0m e[0mBEGINe[0m  
e[4;36;1mComment Create (0.001000)e[0m e[0;1mINSERT INTO `comments`  
(`name`, `status`, `updated_at`, `pattern_id`, `user_id`, `comment`,  
`created_at`) VALUES(‘Knut L.’, NULL, ‘2008-09-29 16:39:43’, 2, 1,  
‘kllklk’, ‘2008-09-29 16:39:43’)e[0m  
e[4;35;1mSQL (0.051000)e[0m e[0mCOMMITe[0m  
Rendering comment/createajax  
Completed in 0.50100 (1 reqs/sec) | Rendering: 0.00300 (0%) | DB:  
0.07000 (13%) | 200 OK [[http://127.0.0.1/comment/createajax](http://127.0.0.1/comment/createajax)]

Nothing missing ☹

---

<div class="post-metadata">

**Author:** ![mcrj45](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@mcrj45](https://www.ruby-forum.com/u/mcrj45)\
**Post date:** [September 29, 2008, 11:49pm UTC](https://www.ruby-forum.com/t/rjs-is-not-loaded/149796/4 "2008-09-29T23:49:30Z")

</div>

Frederick C. wrote:

> On Sep 29, 10:12ï¿½pm, Knut L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> Any javascript errors?  
> When I load the page in IE or FF no error is shown.  
> (if you haven’t already installed firebug then  
> install it now - it will tell you a lot more when javascript errors  
> crop up).  
> I have FB open, but the page looks ok. When I click on the send button,  
> no action is startet. Where should I look for mentioned JS errors in the  
> FB? I have currently only use the HTML view

> If your form\_remote\_tag/link\_to\_remote/etc… is using an :update  
> option, then ditch it.  
> My partial contains:

\<%= render :partial =\> 'comment/list', :collection =\> @pattern.comments %\>

An the form which sends the request is setup by:  
\<% form\_remote\_for :comment, :url =\> {:controller =\> “comment”, :action  
=\> “createajax” }, :html =\> { :id =\> ‘comment\_form’ } do |f| %\>  
So nothing to ditch used ☹ or did I get your wrong?

> Fred

Cheers,  
Knut

---

<div class="post-metadata">

**Author:** ![mcrj45](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f1d935/32.png) [@mcrj45](https://www.ruby-forum.com/u/mcrj45)\
**Post date:** [September 29, 2008, 11:45pm UTC](https://www.ruby-forum.com/t/rjs-is-not-loaded/149796/5 "2008-09-29T23:45:15Z")

</div>

On Sep 29, 10:12 pm, Knut L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Shandy N. wrote:
> 
> > Is your log file giving any hints as to what is happening, such as  
> > method missing, etc?
> 
> Hi Shandy,  
> my logs are looking ok (from my point of view):

Any javascript errors? (if you haven’t already installed firebug then  
install it now - it will tell you a lot more when javascript errors  
crop up).  
If your form\_remote\_tag/link\_to\_remote/etc… is using an :update  
option, then ditch it.

Fred
