Does anyone know how to get the radio_button helper to set the html "checked" option? Thanks, Curt
On Sun, 6 Mar 2005 23:50:06 -0600, Curt Hibbs <curt-fk6st7iWb8MAvxtiuMwx3w@public.gmane.org> wrote:> Does anyone know how to get the radio_button helper to set the html > "checked" option?http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#M000092 radio_button("post", "category", "rails") radio_button("post", "category", "java") The first one would be checked if @post.category == "rails", the second one would be checked if @post.category == "java", etc... HTH -- Mike Pilat mpilat-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Mike Pilat wrote:> > On Sun, 6 Mar 2005 23:50:06 -0600, Curt Hibbs <curt-fk6st7iWb8MAvxtiuMwx3w@public.gmane.org> wrote: > > Does anyone know how to get the radio_button helper to set the html > > "checked" option? > > http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.h > tml#M000092 > > radio_button("post", "category", "rails") > radio_button("post", "category", "java") > > The first one would be checked if @post.category == "rails", the > second one would be checked if @post.category == "java", etc...I knew it was going to be simple... but somehow I didn''t get it when I read the docs. Thanks, Curt