Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
:id_element attribute not working #69
Comments
leobossmann
closed this
Jul 14, 2011
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
leobossmann
Jul 14, 2011
Contributor
…nevermind, it works, seems some misconfiguration on my side caused it.
…nevermind, it works, seems some misconfiguration on my side caused it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
nicholaspufal
Jul 19, 2011
What you did to solve that? Here the field always displays 0 (can see it on the server log, when I submit it).
nicholaspufal
commented
Jul 19, 2011
What you did to solve that? Here the field always displays 0 (can see it on the server log, when I submit it). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
leobossmann
Jul 21, 2011
Contributor
That is the strange thing about it, I have no idea. I wrote the ticket above and suddenly it worked. I changed absolutely nothing.That's why I suspect that my configuration is somewhat flawed, I use a Rails Turnkey Linux, maybe that's the culprit…
That is the strange thing about it, I have no idea. I wrote the ticket above and suddenly it worked. I changed absolutely nothing.That's why I suspect that my configuration is somewhat flawed, I use a Rails Turnkey Linux, maybe that's the culprit… |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
nicholaspufal
Jul 21, 2011
Thanks for the reply.
But my guess is that you assertion is true. It should be "data-id-element" => this is HTML5 compatible. "id_element" isn't.
I did solve it here by using :update_elements instead of :id_elements. That way worked fine.
Did create another issue with that info:
Just in case you or any other need that reference ;)
nicholaspufal
commented
Jul 21, 2011
Thanks for the reply. But my guess is that you assertion is true. It should be "data-id-element" => this is HTML5 compatible. "id_element" isn't. I did solve it here by using :update_elements instead of :id_elements. That way worked fine. Did create another issue with that info: Just in case you or any other need that reference ;) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
andreteves
Jul 21, 2011
I tried "update_elements" but it didn't work for me, I get an error with JSON.generate (maybe because I'm using json_pure as default encoder). Any help?
However, this commit fixed my problem with id_element not rendering "data-id-element":
andreteves
commented
Jul 21, 2011
I tried "update_elements" but it didn't work for me, I get an error with JSON.generate (maybe because I'm using json_pure as default encoder). Any help? However, this commit fixed my problem with id_element not rendering "data-id-element": |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
sandrods
Jul 21, 2011
I don't think this issue should be closed.
The expected beahviour does not work. The commit above should be incorporated in the gem, don't you think?
sandrods
commented
Jul 21, 2011
I don't think this issue should be closed. |
leobossmann
reopened this
Jul 21, 2011
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
leobossmann
Jul 21, 2011
Contributor
I agree, I just tried it on a different machine, with the same results as above. Gonna try again tomorrow and will post the results.
I agree, I just tried it on a different machine, with the same results as above. Gonna try again tomorrow and will post the results. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
leobossmann
Jul 22, 2011
Contributor
@andreteves, your commit fixed the problem for me, thanks a lot!
@nicholaspufal, I tried the :update_elements thing, it resulted in a JSON Error as well, however I didn't use the autocomplete_field_tag, maybe that's the problem…
@andreteves, your commit fixed the problem for me, thanks a lot! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
leobossmann
Jul 23, 2011
Contributor
@andreteves, I have have issued a pull request with your fix, is that alright with you?
@andreteves, I have have issued a pull request with your fix, is that alright with you? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
andreteves
commented
Jul 23, 2011
Sure! |
added a commit
to juniorz/rails3-jquery-autocomplete
that referenced
this issue
Jul 28, 2011
added a commit
that referenced
this issue
Aug 8, 2011
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Show comment Hide comment
Merged and released as 0.9.1 |
leobossmann commentedJul 14, 2011
Hi,
first of all thanks for the gem, it works like a charm, I just have one (hopefully minor) issue.
I have managed to succesfully integrate an autocomplete text field. It works so far and pulls the right data. I want to update a hidden field with the id it pulls from the database and that is exactly where the problem is:
In my form I have the following:
purchase_order_customer_id is a normal text field, which should, by my understanding, be updated with the id value of the option I selected in the autocomplete dropdown.
It renders as:
<input data-autocomplete="/purchase_orders/autocomplete_customer_last_name" id="purchase_order_customer_name" id_element="#purchase_order_customer_id" name="purchase_order[customer_name]" size="30" type="text" />
The :id_element attribute gets rendered as normal HTML attribute, therefore the update does not work.
Shouldn't it be rendered as something like
data-id-element ="#purchase_order_customer_id'
in order to work?Or am I missing something here? I tried to follow the readme as closely as possible, please bear with me If I'm asking stupid questions, this is my first rails project…
Thanks in Advance
Leo