Forum: Ruby on Rails Puzzled by "radio_button".

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3df897745c664e3add6f047daa5835d1?d=identicon&s=25 MenDAKE (Guest)
on 2006-04-07 00:39
I have what seems like simple, working code:

<form action="save_dh_options" method="post">
	<fieldset>
		<legend>DH Work Reports</legend>
		<p>Would you like to fill a work report?</p>
		<p><%= radio_button("user", "enable_report", "yes") %><label
for="yes"> Yes</label><br />
		<%= radio_button("user", "enable_report", "no") %><label for="no">
No</label><br /></p>
	</fieldset>

	<p><input type="submit" name="save" value="Save Changes" class="button"
/></p>
</form>

The radio_button command is linked to the field user.enable_report,
which is a simple enum("yes", "no"). Field. When I click the submit
button the data is saved just fine to the database, but the radio
buttons do not reflect the changes. They're always set to "Yes". Can
anyone tell what I'm doing wrong?
3df897745c664e3add6f047daa5835d1?d=identicon&s=25 MenDAKE (Guest)
on 2006-04-07 21:38
Never mind. Problem eventually solved.
This topic is locked and can not be replied to.