-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autocomplete source is an array #66
Comments
Not entirely sure based on the level of detail you have provided here, but this sounds like you may just need to override the You can see an answer I posted on Stack Overflow detailing how this works. |
Here is my question in more detail. |
Did you look in detail at the answer I provided to the other question on Stack Overflow? The question may be different, but the solution to your problem should be the same. Out of the box the gem solves the issues of doing lookups directly off the models since that is the most common use case, but the flexibility to get a custom result is available by overriding the I also noticed in your Stack Overflow question you mentioned you are trying to follow along with a RailsCast video while implementing this. That video is of some old unmaintained gem that has no relation to this project. |
One more issue. I did as you suggested and made a custom
Here is my method. Any idea why? Can't find any docs about this really. My strings don't have ids.
|
@SupremeA Are you able to replicate it on a git repo that I can see? I don't think there is enough information to help debug that particular issue otherwise. |
@bigtunacan I can't replicate it on a git repo, but I think my issue is coming from the Source Code here. Should i be able to overwrite this method to not ask for an id? Or would it be easier to make another model and pass my array to there and let the gem autocomplete from that model. Im trying to figure out the path of least resistance. |
I want to use rails-jquery-autocomplete but my source is a dynamic array from a field in my model. The documentation only talks about the source being separate model instances. Is there a way to make it use an array and look at each array item as a separate object when querying the source?
The text was updated successfully, but these errors were encountered: