void value expression when accessing constant from view

I'm working on a Rails app using version 2.3.4. I've got a big form somewhere that uses nested attributes, but I can't seem to access the constants from the other class.

Here's basically what I'm doing:

class User < ActiveRecord::Base    has_one :pref end

class Pref < ActiveRecord::Base    FOO = 1 end

And in app/views/user.html.erb:

<% form_for( :user, :url => { :action => go_to, :id => id }, :html => { :multipart => true, :id => "user_form" } ) do |f| %>    <%- fields_for :email_pref do |p| -%>      <%= p.radio_button :bar, Pref::FOO %>      <%= p.label :bar, "Bar", :value => Pref::FOO %>      ...    <%- end -%>    ... <%- end -%>

Of course there's quite a bit more code than that, but this is where it goes wrong. My error is:

/app/models/pref.rb:59: void value expression

Below it the code of the view, pointing out an error in the first line that uses Pref::FOO I checked if it really is Pref::FOO that's the problem by adding <%= Pref::FOO %> before the radiobutton. Also, User::FOO (and declaring the constant in the User class) works perfectly fine. So it looks like I can't access a Pref constant from a User view, but that sounds unreasonably limiting to me. I also tried ::Pref::FOO, which also doesn't work. I really do want this constant in the Pref class. Putting it in User is not a good solution for me.

Any idea why this is a problem and how to solve it?

And what does this mysterious "void value expression" mean? Googling it yields very few results (and most of them are the same).

mcv.

Perhaps in your users_controller action(s), you should create an instance of the Pref class for the view to work with?

Why should I need an instance? Aren't constants tied to the class rather than an instance?

mcv.