Note that there are some explanatory texts on larger screens.

plurals
  1. PORails - Ajax call renders my action and the parent page
    primarykey
    data
    text
    <p>in the <code>new</code> action of my <code>contracts</code> controller, I have an ajax link to a non RESTful action</p> <pre><code>&lt;%= link_to "Select negotiation", negotiations_list_negotiations_path(:user_id =&gt; current_user), {:remote =&gt; true, :id =&gt; 'related_negotiation_add_link', 'data-controls-modal'=&gt;"related_negotiation", 'data-backdrop' =&gt; true, 'data-keyboard'=&gt; true} %&gt; </code></pre> <p>This link populates a list of records in a modal window (I'm using Twitter's bootstrap modal here).</p> <p>It works pretty well, but I've discovered by looking at my logs that it also made a call to the <code>new</code> action again. see the logs below (I've removed the SQL parts):</p> <pre><code>Started GET "/negotiations/negotiations_list?user_id=65" for 127.0.0.1 at 2011-12-03 15:47:24 +0100 Processing by NegotiationsController#negotiations_list as JS Parameters: {"user_id"=&gt;"65"} Rendered negotiations/negotiations_list.js.erb (18.9ms) Completed 200 OK in 78ms (Views: 24.7ms | ActiveRecord: 21.7ms) Started GET "/contracts/new" for 127.0.0.1 at 2011-12-03 15:47:24 +0100 Processing by ContractsController#new as */* Rendered contracts/_submenu.html.erb (6.2ms) Rendered shared/_category_dropdown.html.erb (14.0ms) Rendered contracts/_form.html.erb (199.8ms) Rendered contracts/new.html.erb within layouts/application (213.7ms) Rendered shared/_flash.html.erb (0.0ms) Completed 200 OK in 260ms (Views: 238.1ms | ActiveRecord: 18.3ms) </code></pre> <p>Can anyone please explain while the <code>/contracts/new</code> action is triggered again, and how to stop this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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