Hi there,
I have a form which has a variety of fields and field types. Each
field is presenting a unique challenge in understanding how the active
option is selected by default from data in the corresponding model.
In one instance, I have two radio buttons, "on" and "off."
In the
controller, I load up the boolean value for the user''s settings from
the model user > notifications.
In the view I have the following:
<%= radio_button :user, :notifications, 1, :onclick =>
"Field.enable(''time''),
Field.enable(''period'')" %> on
<%= radio_button :user, :notifications, 0, :onclick =>
"Field.disable(''time''),
Field.disable(''period'')" %> off
I''ve added :checked => checked to get a default option (so I know
that
works), but what I want is for the checked option to correspond to the
state in the model :user, :notifications. How do i do this???
These form helpers I''m finding confusing for this. Thanks for the
help.
-Alex
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---