From: Dustin Anderson Date: 2007-04-04T23:59:03+09:00 Subject: Re: Problem Extracting Array Values > Dustin, why are you storing those values that way? Why not have a > normalized table with a row for each? In other words you create a > blocks table, define a Block model which belongs_to whatever model you > currently use the blocks column in, and then that model will have many > blocks. Then you could just do @model.blocks.each do |block| in your > view. > > Ryan Thanks Chris, ilan, Ryan for the help... You got it exactly correct. Ryan - I think you're right - I was storing the value in the database like that because it's a variable for a Javascript app. I'm writing an app to allow users to store the state of the view (like Google personalized homepage or netvibes) and the javascript that I'm using requires a v to look like this: value = ["block1_name", "block2_name", "block3_name"] so, if I store "value" in the database like this, I can just read it into my javascript. Otherwise, I'll need a helper to construct the string to look like this. thanks again. Dustin Ps. sorry ilan for posting in the Ruby forum - I thought it was just a simple ruby array question, but obviously it does have something to do with Rails. For the record - the javascript app i'm using for drag/drop portal is here: http://aymanh.com/drag-drop-portal-interface-with-scriptaculous -- Posted via http://www.ruby-forum.com/.