Hey Rodrigo,

Have you looked inside db/seeds.rb?  That file demonstrates seeding a City 
model.  Other things you can do, depending on what you need the data to look 
like are simple things like:

states = %w[Alabama Alaska Arkansas]

I also think Ryan did a railscast on models that don't exist in the database, 
in case you need more model-like behavior than an array of strings would give 
you.

Good luck!
On Jul 12, 2011, at 12:58 PM, Rodrigo Ruiz wrote:

> I watched the railscast episode 88: 
> http://railscasts.com/episodes/88-dynamic-select-menus?autoplay=true
> Only problem is that it uses a State and Country model that are not shown. 
> Can anyone help me with this? I mean, how am I supposed to do this, should 
> i manually populate the database at the console?
> 
> Also, is there a way to do this without saving states and countries to the 
> database (just to save some space)?
> 
> And further more, is there a way to do this without javascript? (for example, 
> with observer_field like in 
> http://www.plexusweb.com/staff/charlie/blog/post/302/Dynamic-Select-Menus-in-Rails-using-ObserveField
>  ?   problem is I think observer_field no longer exists for rails 3).
> 
> Thank you,
> Rodrigo
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/rubyonrails-talk?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to