[Rails] Re: Radio button required field class

2014-10-17 Thread Matt Jones


On Friday, 17 October 2014 03:46:49 UTC-4, M,Gopi M.gopinath wrote:
>
> Hi,
>
> I need to add a required class in gender radio button. How this can be 
> done.
>
> 
> I am  class="astris">*
> <%= f.radio_button :gender, 'm', :class => 'RadioInput' %>Male
> <%= f.radio_button :gender, 'f', :class => 'RadioInput' %>Female
> 
>
> classname  = required
>
> If I am adding like this then it display two validation message for each 
> radio button.
>
> <%= f.radio_button :gender, 'm', :class => 'RadioInput required' %>Male
> <%= f.radio_button :gender, 'f', :class => 'RadioInput required' %>Female
>
> I need to get a single validation msg if none of the radio button is 
> selected.
>
>
What Colin said - there's not a single "element" for radio buttons. You 
didn't state which Javascript library you're using, but presumably it has a 
solution for radio buttons.

Also note that the ability to not have any of them checked is widely 
supported among browsers but not in keeping with the standard:

http://www.w3.org/TR/html401/interact/forms.html#radio

--Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/2071bffc-05e4-4956-bb51-f667fe8e0a16%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Re: Ruby on Rails (ROR) Development Services

2014-10-17 Thread Matt Jones


On Thursday, 16 October 2014 09:18:13 UTC-4, Ruby-Forum.com User wrote:
>
> Panzer Technologies is well prepared to provide the best staffing 
> solutions and when it comes to ruby on rails development, it stands out 
> as a distinguished company, with required expertise in ROR. 
>
> To get more information please visit our website @ 
>
>
Tell your website people that *bolding random words* isn't worth pagerank, 
if it ever was...

--Matt Jones

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/a2854f64-6500-45b2-a665-0f36e5f238d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [Rails] Radio button required field class

2014-10-17 Thread Colin Law
On 17 October 2014 08:46, M,Gopi M.gopinath  wrote:
> Hi,
>
> I need to add a required class in gender radio button. How this can be done.
>
> 
> I am  class="astris">*
> <%= f.radio_button :gender, 'm', :class => 'RadioInput' %>Male
> <%= f.radio_button :gender, 'f', :class => 'RadioInput' %>Female
> 
>
> classname  = required
>
> If I am adding like this then it display two validation message for each
> radio button.
>
> <%= f.radio_button :gender, 'm', :class => 'RadioInput required' %>Male
> <%= f.radio_button :gender, 'f', :class => 'RadioInput required' %>Female
>
> I need to get a single validation msg if none of the radio button is
> selected.

Asssuming that the second one is for css purposes (or similar) then it
would be better to move the class out to a surrounding element, the
td, tr or even form for example.

Colin

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLtPV6Gau1yBnLrnc6EdBwUWqQOn16TT--5HrovbqdjUjA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[Rails] Radio button required field class

2014-10-17 Thread M,Gopi M.gopinath
Hi,

I need to add a required class in gender radio button. How this can be done.


I am *
<%= f.radio_button :gender, 'm', :class => 'RadioInput' %>Male
<%= f.radio_button :gender, 'f', :class => 'RadioInput' %>Female


classname  = required

If I am adding like this then it display two validation message for each
radio button.

<%= f.radio_button :gender, 'm', :class => 'RadioInput required' %>Male
<%= f.radio_button :gender, 'f', :class => 'RadioInput required' %>Female

I need to get a single validation msg if none of the radio button is
selected.


Thanks in advance ...

Best Regards,

*Gopinath M*

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/CAPDEix%2BKML8mjXL-24JBp8D4Ej03tqhSMn%3DfVnyqvJhL5PdtFw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.