I have a Products and ProductSize, that connected by product_id. This my controller and model below.
def index @q = Product.ransack(params[:q]) @products =