Problem with collection_select

Hi all.

I have a problem with collection_select, hope you guys can help me.

User has one Address, and Address has one Province. Here are my
models :

models/user.rb

class User < ActiveRecord::Base
has_one :address, :dependent => :destroy

models/address.rb

class Address < ActiveRecord::Base
has_one :province
belongs_to :user

models/province.rb

class Province < ActiveRecord::Base
belongs_to :country, :address

I need to populate a select tag contains list of all provinces. How
can I do that? I’ve tried use collection_select but isn’t working.

Thank you.

–William

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs