You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I've implemented a nested select and it all renders. But my the values in the second field are not scoped to the selection of the first field and if I look in the controller action that handles this, no ID is being passed to it at all to scope based off of
To Reproduce
class Order < ApplicationRecord
belongs_to :shipping_address
belongs_to :customer
class Customer < ApplicationRecord
has_many :orders
has_many :shipping_addresses
accepts_nested_attributes_for :shipping_addresses
end
class ShippingAddress < ApplicationRecord
has_many :orders
belongs_to :customer
ActiveAdmin.register Order do
form do |f|
f.inputs "Customer" do
f.input :nested_shipping_address,
as: :nested_select,
minimum_input_length: 0,
level_1: {
attribute: :customer,
},
level_2: {
attribute: :shipping_address,
display_name: :address_1,
}
end
When I bind in the controller that handles the index request, here are what the params look like: => #<ActionController::Parameters {"order"=>"name_desc", "q"=>{"groupings"=>{"0"=>{"m"=>"or", "name_cont"=>""}}, "combinator"=>"and", "customer_eq"=>"-1"}, "controller"=>"admin/shipping_addresses", "action"=>"index"} permitted: true>
Additional context
I've also been completely unable to figure out how to view the js in the browser or to try to figure out a way to monkey patch any of this. Open to suggestions on that if anyone know what to do.
The text was updated successfully, but these errors were encountered:
This made the parameters like this: {"order"=>"id_desc", "q"=>{"groupings"=>{"0"=>{"m"=>"or", "id_eq"=>"", "plate_number_cont"=>""}}, "combinator"=>"and", "customer_id_eq"=>"9"}, "customer_car"=>{}}
Describe the bug
I've implemented a nested select and it all renders. But my the values in the second field are not scoped to the selection of the first field and if I look in the controller action that handles this, no ID is being passed to it at all to scope based off of
To Reproduce
When I bind in the controller that handles the index request, here are what the params look like:
=> #<ActionController::Parameters {"order"=>"name_desc", "q"=>{"groupings"=>{"0"=>{"m"=>"or", "name_cont"=>""}}, "combinator"=>"and", "customer_eq"=>"-1"}, "controller"=>"admin/shipping_addresses", "action"=>"index"} permitted: true>
Additional context
I've also been completely unable to figure out how to view the js in the browser or to try to figure out a way to monkey patch any of this. Open to suggestions on that if anyone know what to do.
The text was updated successfully, but these errors were encountered: