Forum: Ruby on Rails Formatting a list from the DB

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
96931bfe0c2948f47a98e15ae52e5637?d=identicon&s=25 Chris Carter (cdcarter)
on 2006-04-03 16:15
I am working on a project where there is a table called mixes.  You
create a new Mix and in the contents box, you type in the name of the
songs used.  Because the number of tracks could be unlimited, I decided
to use a text box.  Is there anyway I can have my views make the list
look right, instead of as a jumble of text.  Or, would there be some
way, using arrays and maybe ajax, so the user would see perhaps 10
inputs, and could hit a button and a new field would appear, and this
would go into the db as an array?  Thanks!
42172acdf3c6046f84d644cb0b94642c?d=identicon&s=25 Pat Maddox (pergesu)
on 2006-04-03 16:20
(Received via mailing list)
You can format a bunch of text using RedCloth[1].  For your app,
however, it seems like it'd make a lot more sense to have a Song
model, which belongs_to :mix.  A Mix has_many :songs.  Yes you can
dynamically add a bunch of songs..take a look at the ajax scaffolding
for some ideas on getting started.

Pat

[1] http://whytheluckystiff.net/ruby/redcloth/
96931bfe0c2948f47a98e15ae52e5637?d=identicon&s=25 Chris Carter (cdcarter)
on 2006-04-03 16:41
Pat Maddox wrote:
> You can format a bunch of text using RedCloth[1].  For your app,
> however, it seems like it'd make a lot more sense to have a Song
> model, which belongs_to :mix.  A Mix has_many :songs.  Yes you can
> dynamically add a bunch of songs..take a look at the ajax scaffolding
> for some ideas on getting started.

I will look into RedCloth.  The reason I want to avoid a model for Song
is because then it is quite probable I would end up with 12 "Eleanor
Rigby"s or something.
This topic is locked and can not be replied to.