Closed maxstudener closed 11 years ago
Did you configure Autocomplete? You need to make sure to specify config.aa_associations.autocomplete_models
in config/application.rb
.
module LUCom class Application < Rails::Application
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
config.aa_associations.autocomplete_models %(group product)
still no avail
Can you change that to:
config.aa_associations.autocomplete_models = %w(group product)
See if that helps.
It seems like i have a similar issue: undefined method `relate_admin_sale_section_path' for #<#Class:0x007fc464488070:0x007fc46441ac78>
class SaleSection < ActiveRecord::Base
has_and_belongs_to_many :products accepts_nested_attributes_for :products
end
ActiveAdmin.register SaleSection do association_actions
form :partial => "admin/shared/form"
form_associations do association :products, [:name, :sku] end end
class Product < ActiveRecord::Base has_and_belongs_to_many :sale_sections autocomplete :name, :format_label => proc {|p| label = "#{p.name} - #{p.sku}" label } end
I have this in config/application : config.aa_associations.autocomplete_models = %w(sale_section product)
You are correct it was the missing =
I realized why i am getting this error. I have nested resources for sale and sale_sections. When i commented out the
"#belongs_to :sale, :finder => :find_by_permalink" in the AA resource definition block the edit form worked just fine.
Is there something i am missing in this case?
@lpopa this would be a different issue. Also, not sure why belongs_to
would effect this. Can you open up a separate issue for this, and I'll look into when I can. If you discover what the root issue is or find a fix, feel free to submit a pull request, I'd happily accept it.
The Autocomplete is ajax calling "/autocomplete/#{assoication}?q=#{search}"
But this routes doesnt exist, documentation doesn't say anything about this.
Do we need to add our own controller and return json?