Note that there are some explanatory texts on larger screens.

plurals
  1. PORails: best_in_place collection issue
    primarykey
    data
    text
    <p>My app runs on two different database, and I use the application logic to work on them.</p> <p>I have the <strong>User model</strong> on an <strong>external db</strong> and I only records the <strong>id</strong> on my <strong>default_role class</strong>. </p> <p>So in the index template I fetch the accounts from remote, and for each of them <strong>I have to query my table</strong> to print some immutable information and I want to give the possibility to <strong>change role in my table</strong></p> <p>Index information = remote tables information (name surname ecc) + my table information (role)</p> <p>Using best_in_place to edit the role_id field of my users. </p> <p><strong>The problem is my index cycle @operators which comes from outside buy I need to change role which is on my side!</strong></p> <pre><code>- @operators.each do |ope| #cycle users %tr %td - user = User.find_by_bay_id(ope.account_id) - df = DefaultRole.find_by_operator_id(user.id) = best_in_place [:admin, df], :role_id, :type =&gt; :select, :collection =&gt; [[1, 'admin'], [2, 'coordinator'], [3, 'operator'], [4, 'base']] </code></pre> <p>and my update in controller:</p> <pre><code>respond_to :html, :json def index @operators = some logic from model where I get all the users end def update @df = DefaultRole.find(params[:id]) @df.update_attributes(params[:default_role]) respond_with [:admin, @df] end </code></pre> <p>But it didn't even call my update method in the controller. It normally checks the collection tag, allows me to change it but it doesn't allow me to submit.</p> <p>What am I doing wrong?</p> <p><strong>EDIT</strong></p> <p>My browser doesn't catch any request.</p>
    singulars
    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.
 

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