RJS is not loaded

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 :slight_smile: Thank you!!! Cheers, Knut

Knut Linke wrote:

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

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

Shandy Nantz 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 Linke", "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 Linke', 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\]

Nothing missing :frowning:

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

Frederick Cheung wrote:

On Sep 29, 10:12�pm, Knut Linke <rails-mailing-l...@andreas-s.net> 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: <div id="comment"> <%= render :partial => 'comment/list', :collection => @pattern.comments %> </div>

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 :frowning: or did I get your wrong?

Fred

Cheers, Knut