Comments (13)
Does your Message model has an attribute account_name ?
If it doesn't or you don't need it perhaps you can add it using attr_accessor :account_name
from rails3-jquery-autocomplete.
the messsage model doesn't have attr_accessor...should I add it? I didn't see it in the README...trying it now!
from rails3-jquery-autocomplete.
hmmm....still not workin...?
from rails3-jquery-autocomplete.
I added attr_accessor :account_name -- in my other app where I used this, I didn't have to do that....what else could be doing this? where is the "account_name" method created (equivalent to brand_name)
from rails3-jquery-autocomplete.
same for me. attr_accessor is a workaround. i't should not be complicated.
from rails3-jquery-autocomplete.
Did you ever get this resolved? I am facing a similar isseu
from rails3-jquery-autocomplete.
This gem does nothing to create the attribute on the model that will receive the autocompleted input. :account_name must be either a database field on the model or a attribute added via attr_accessor
from rails3-jquery-autocomplete.
The example provided is incorrect? In the example, the model (Brand) is different from the controller (Product) and still in the View, we have:
form_for @product do |f|
f.autocomplete_field :brand_name, autocomplete_brand_name_products_path
end
Clearly name
is a database field of Brand and not Product. And this is exactly what my requirement is, but it is not working with the same issue/error message.
from rails3-jquery-autocomplete.
I was having the same issue as above, following along with the readme. The change which made it work was use :name instead of :brand_name (basically exactly what you would use with any other form helper). Maybe the readme needs to be updated?
from rails3-jquery-autocomplete.
Sidk , How is it that is doesn't use :name of upper model ... you use :name already in Master model :/
from rails3-jquery-autocomplete.
Not sure I understand the question, because you can of course have the same
attribute name in different models.
On Thursday, November 27, 2014, AmerPandzo [email protected] wrote:
Sidk , How is it that is doesn't use :name of upper model ... you use
:name already in Master model :/—
Reply to this email directly or view it on GitHub
#54 (comment)
.
from rails3-jquery-autocomplete.
I see that you didn't understood. You have form_for @Product do |f| ... PRODUCT .. DO F ... not account or some other model .. .so if i have :name in products , and :name in accounts .. your alleged usage of :name INSIDE OF form_for @Product do |f| ... f.name ... could not give you name of account , it will give you a product name .. not account that we are suppose to get ...
from rails3-jquery-autocomplete.
Oh, I see where the confusion is. You're right that f.name is for @Product. The form is for creating a product and as such the form helper should use either a column in the Product table or an attr_accessor set on the Product model.
autocomplete_brand_name_products_path and the rest of the setup done for the Brand model and the welcome controller (in the readme) is where it'll get the brand names from.
from rails3-jquery-autocomplete.
Related Issues (20)
- Specifying custom encoder via block doesn't work.
- Autocomplete on the application controller HOT 1
- Update readme to include path to Rails 4 version HOT 2
- Allow Model Methods to be accessed through :extra_data HOT 1
- jQuery autocomplete list (ui-menu-item) does not populate HOT 2
- NoMethodError (undefined method `scoped' for #<Class:0x007fdf44e453b0>): HOT 2
- NoMethodError - undefined method `id' for #<Hash HOT 2
- Rails 4 strong parameters HOT 3
- undefined is not a function HOT 10
- Does this work on Rails4? HOT 2
- No superclass method `get_autocomplete_items' HOT 6
- autocomplete not working on ajax loaded forms HOT 1
- Not working without Mongoid HOT 1
- Action not found HOT 2
- _renderItem is supported?
- DEPRECATION WARNING HOT 1
- Enable Sourcegraph HOT 1
- 1.0.11 was last release? HOT 2
- How can I add an ID - Field to the search?
- Failed to load resource. 500 error
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rails3-jquery-autocomplete.