Re: [Rails] Nested Attributes and Radio Buttons -- any way to do this?

2012-12-27 Thread Dheeraj Kumar
The second selector is correct. Converting it to jQuery, it's $('input[data-radio-group="foo"]:checked').first().val(); -- Dheeraj Kumar On Thursday 27 December 2012 at 10:50 PM, Walter Lee Davis wrote: > > On Dec 27, 2012, at 12:14 PM, Walter Lee Davis wrote: > > > > > On Dec 27, 2012,

Re: [Rails] Nested Attributes and Radio Buttons -- any way to do this?

2012-12-27 Thread Walter Lee Davis
On Dec 27, 2012, at 12:14 PM, Walter Lee Davis wrote: > > On Dec 27, 2012, at 6:33 AM, Gauthier D. wrote: > >> Compared to "real" radio groups, I loose the ability to quickly get the >> "group value" but I don't need that in my case. > > You might try this: > > $$('input[data-radio-gro

Re: [Rails] Nested Attributes and Radio Buttons -- any way to do this?

2012-12-27 Thread Walter Lee Davis
On Dec 27, 2012, at 6:33 AM, Gauthier D. wrote: > Compared to "real" radio groups, I loose the ability to quickly get the > "group value" but I don't need that in my case. You might try this: $$('input[data-radio-group="foo"][checked]').first().getValue(); That's Prototype, but you sh

Re: [Rails] Nested Attributes and Radio Buttons -- any way to do this?

2012-12-26 Thread Walter Lee Davis
On Dec 26, 2012, at 12:56 PM, Gauthier D. wrote: > Samantha John wrote in post #1032986: >> I'd recommend creating an attr_accessor for :primary on your Title >> model. >> In your form you could do something like: >> f.object.roles.each do |role| >> f.radio_button :primary, :role.id >> f.label

[Rails] Nested Attributes and Radio Buttons -- any way to do this?

2011-08-10 Thread Walter Lee Davis
I have the following: class Title has_many :roles has_many :people, :through => :roles accepts nested_attributes_for :roles (Roles and People are also correctly defined) In my title#edit view, I have the fields_for set up correctly and working: <%= f.fields_for :role