Note that there are some explanatory texts on larger screens.

plurals
  1. PORails: link_to_remote update doesn't render the view
    text
    copied!<p>I have a link_to_remote to render the edit action of an object. But all it does is update the Dom Element with this response</p> <pre><code>try { } catch (e) { alert('RJS error:\n\n' + e.toString()); alert(''); throw e } </code></pre> <p>My link looks like this:</p> <pre><code>= link_to_remote t("txt.edit"), :update =&gt; dom_id(comment), :url =&gt; edit_comment_path(comment.id) </code></pre> <p>My edit action in the comment controller:</p> <pre><code> # GET /comments/1/edit def edit @comment = Comment.find(params[:id]) respond_to do |format| format.html format.js { render :action =&gt; "edit" } end end </code></pre> <p>The request seems to be ok, according to the log:</p> <pre><code>Processing CommentsController#edit (for 127.0.0.1 at 2009-04-08 18:55:36) [GET] Session ID: 1d4b9b3d3319d5cd556d00d2e053b651 Parameters: {"authenticity_token"=&gt;"5d70f9e5beded361ee7e87ee591512411e8f3eec", "id"=&gt;"18"} User Columns (2.0ms) SHOW FIELDS FROM `users` User Load (0.5ms) SELECT * FROM `users` WHERE (`users`.`id` = 1) LIMIT 1 Account Columns (1.6ms) SHOW FIELDS FROM `accounts` Account Load (0.2ms) SELECT * FROM `accounts` WHERE (`accounts`.`subdomain` = 'xxx') LIMIT 1 Comment Columns (1.7ms) SHOW FIELDS FROM `comments` Comment Load (0.6ms) SELECT * FROM `comments` WHERE (`comments`.`id` = 18) Rendering comments/edit Completed in 30818ms (View: 2, DB: 7) | 200 OK [http://xx.xxx.rails/comments/18/edit?authenticity_token=5d70f9e5beded361ee7e87ee591512411e8f3eec] </code></pre> <p>What am I doing wrong? Thanks for the help!</p> <p>UPDATE: It works by the way with a RJS template - that's how I solved it now. But I still prefer a solution where a view is rendered. Otherwise I have to create a partial just for this purpose (I cannot render Views with rjs page updates - at least I don't know how).</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload