Coder Social home page Coder Social logo

Comments (13)

dabit avatar dabit commented on May 18, 2024

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.

angelacode avatar angelacode commented on May 18, 2024

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.

angelacode avatar angelacode commented on May 18, 2024

hmmm....still not workin...?

from rails3-jquery-autocomplete.

angelacode avatar angelacode commented on May 18, 2024

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.

zallesov avatar zallesov commented on May 18, 2024

same for me. attr_accessor is a workaround. i't should not be complicated.

from rails3-jquery-autocomplete.

ilankasan avatar ilankasan commented on May 18, 2024

Did you ever get this resolved? I am facing a similar isseu

from rails3-jquery-autocomplete.

dabit avatar dabit commented on May 18, 2024

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.

vandamon avatar vandamon commented on May 18, 2024

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.

sidk avatar sidk commented on May 18, 2024

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.

AmerPandzo avatar AmerPandzo commented on May 18, 2024

Sidk , How is it that is doesn't use :name of upper model ... you use :name already in Master model :/

from rails3-jquery-autocomplete.

sidk avatar sidk commented on May 18, 2024

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.

AmerPandzo avatar AmerPandzo commented on May 18, 2024

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.

sidk avatar sidk commented on May 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.