Rails 4, how to update a model field from a different controller? -
i trying update invoice fields, when checking out in carts controller. these must present when checking out, or should fail. however, can't update, less validate them. here code: cart show view: <div class = "row"> <div class = "col-lg-3 col-lg-offset-6 text-left"> <strong>customer: </strong> <%= collection_select(:invoice, :customer_id, @customers, :id, :full_name, {:prompt => 'please select'}, class: 'form-control') %> </div> <div class = "col-lg-3 ext-left"> <strong>seller: </strong> <%= collection_select(:invoice, :employee_id, @employees, :id, :full_name, {:prompt => 'please select'}, class: 'form-control') %> </div> <div class = "col-lg-12 text-right"> <%= form_tag carts_checkout_path, method: :post |f| %> <%= submit_tag 'complete', ...