Re: [Rails] quick syntax question - newbie

2011-02-21 Thread Chris Kottom
Er, yeah, that's not going to work. It's actually part of the Ruby standard lib as part of CGI::HtmlExtension, and now that I'm looking at it more closely, it's not compatible with Rails use. My bad. Rails only supports the radio_button helper, as Jim pointed out. On Mon, Feb 21, 2011 at 2:10 A

Re: [Rails] quick syntax question - newbie

2011-02-20 Thread Jim Ruther Nill
On Mon, Feb 21, 2011 at 2:06 AM, Chris Kottom wrote: > Ah, yes. Sorry about that. The radio_group method isn't a part of the > FormBuilder, so while you can still call it within the scope of the form_for > block, you can't call it the way I told you to. So there really is a radio_group helper

Re: [Rails] quick syntax question - newbie

2011-02-20 Thread Chris Kottom
Ah, yes. Sorry about that. The radio_group method isn't a part of the FormBuilder, so while you can still call it within the scope of the form_for block, you can't call it the way I told you to. You will need to call it similar to: <%= form_for @post do |f| %> ... <%= radio_group "pos

Re: [Rails] quick syntax question - newbie

2011-02-20 Thread Jim Ruther Nill
it should be f.radio_button. more samples at http://api.rubyonrails.org/classes/ActionView/Helpers/FormHelper.html#method-i-radio_button On Sun, Feb 20, 2011 at 10:29 PM, señor tower wrote: > Chris, thanks. > but iam getting an this error after trying your code: > > *undefined method `radio_grou

Re: [Rails] quick syntax question - newbie

2011-02-20 Thread señor tower
Chris, thanks. but iam getting an this error after trying your code: *undefined method `radio_group' for #* am not sure if it is because this is a rails 3 app? I googled this error but noting seemed helpful <%= f.radio_group :postType_id, PostType.all(:order => "name ASC").map {|pt| [ pt.id, pt.

Re: [Rails] quick syntax question - newbie

2011-02-19 Thread Chris Kottom
I think you're looking for something like radio_group. Based on your previous example, I would code it as: <%= f.radio_group :postType_id, PostType.all(:order => "name ASC").map {|pt| [ pt.id, pt.name ] } On Sun, Feb 20, 2011 at 5:21 AM, oliver torres wrote: > Hi all, am writing a simple ap

[Rails] quick syntax question - newbie

2011-02-19 Thread oliver torres
Hi all, am writing a simple app that lets me pick a post type to go under National or International. the code bellow generates a drop-down from where I can pick the options <%= f.collection_select :postType_id, PostType.all(:order => "name ASC"), :id, :name %> what would be the syntax for