I’m trying to create AJAX website with Rails. I ran into the following
problem:
I want to add a Song to my database. There is this _form.rhtml where I
can edit all Song’s attributes. Then I can click ‘Create’ and I’m
done. I want to switch this to AJAX. I thought about using
form_remote_tag, but it seems insufficient to me. One of Song’s
attributes is a list of lyrics authors. I edit this list as follows:
you can enter new author in a text field and press ‘Add’ or you can
click ‘Remove’ on any of existing authors. Unfortunately, to implement
this I’d have to use another remote form and I would land with nested
tags, which is prohibited. So... I think that maybe I could use
link_to_remote or remote_function, but... I would somehow have to pull
out text field values and send them as parameters of the
link_to_remote. Can I do that? And how?