Send list of variable size


#1

I’m developing some sort of imdb (http://www.imdb.com) application for
CDs
to practice Ruby on Rails.
So a user should be able to upload information of a CD that’s not yet in
the
database. But I’m wondering what would be the possible ways to send
information like tracklists. It seems to me the easiest way is a form
with
an input box per track, but how let the user easily specify how many
boxes
he needs?


#2

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

With the Prototype javascript library you could do something like the
following:

  • <%= text_field_tag 'tracks[]' %>
  • <%= link_to_function ‘Add Another Track’, “new Insertion.Bottom
    (‘tracklist’, $(‘track_form’).innerHTML)” %>

    That would put a link on the under the tracklist that will add
    another form element each time it was clicked.

    On Nov 21, 2005, at 10:48 AM, Lieven De Keyzer wrote:

    Rails mailing list
    removed_email_address@domain.invalid
    http://lists.rubyonrails.org/mailman/listinfo/rails

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (Darwin)

    iD8DBQFDgiOuG9xIoXK+giARAkhkAKDbq9v401QvL1P4OgR/zxf1NPgKWACcDm4i
    +fuPkSADwsU9m8rijvjO864=
    =9LEk
    -----END PGP SIGNATURE-----


    #3

    When I click “Add Another Track” it doesn’t do anything with this code.


    #4

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    I just tried it copy pasted and it worked fine.
    Are you sure the prototype library is being included?

    <%= javascript_include_tag ‘prototype’ %>

    should go in at the top of the page.

    On Nov 21, 2005, at 2:19 PM, Lieven De Keyzer wrote:

    Hash: SHA1

    So a user should be able to upload information of a CD that’s

    http://lists.rubyonrails.org/mailman/listinfo/rails


    Rails mailing list
    removed_email_address@domain.invalid
    http://lists.rubyonrails.org/mailman/listinfo/rails

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.1 (Darwin)

    iD8DBQFDgl8OG9xIoXK+giARAmteAJ9TqnRXYAMdEg6nSrmR20tAQ+rJkwCg+TS5
    oecxF1+HmBrk1gsJVBRGOXw=
    =J1j1
    -----END PGP SIGNATURE-----


    #5

    Rails mailing list
    removed_email_address@domain.invalid
    http://lists.rubyonrails.org/mailman/listinfo/rails


    #6

    That was indeed the problem. Sorry. I should start reading about this
    library I guess.