Displaying 20 results from an estimated 1000 matches similar to: "radio_button helper and "checked" option"
2006 Aug 10
3
Radio buttons refusing to load checked...
Hi,
Having big problems with radio buttons that just don''t make sense:
<%= radio_button "events", "impact_type", true %> Positive
<%= radio_button "events", "impact_type", false %> Negative
This should create two radio buttons with the first one checked by 
default, right? Cos it doesn''t :(
Any ideas would be great,
Thanks,
2012 Sep 08
4
dash symbol
In the example below, what is the dash doing between the class
attribute and array:
(field_helpers -
[:label, :check_box, :radio_button, :fields_for, :hidden_field, :file_field]).each
do |selector|
-- 
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to
2006 May 31
2
Storing a NULL value from a radio_button
Hi, I''ve a boolean database field (tinyint(1)) wich allows nulls.
Then, I''ve something like this:
radio_button(''server'',''customer_has_login'',"NULL")
radio_button(''server'',''customer_has_login'',true)
radio_button(''server'',''customer_has_login'',false)
The problem is
2007 Feb 27
2
Dynamically add radio buttons to forms?
Good afternoon all
I''m trying to implement a form that dynamically inserts radio buttons
into a form. The user selects options from a drop-down menu. I use
observe_field to watch for a change and call back to render the
appropriate partial tha contains the radio options. All works nicely
but I''m tripped up on one thing:
When rendering a form using form_for how do I link those
2006 Jul 01
4
Radio_button in loop problem
Hi all, I can''t figure out why my radio_buttons won''t reflect the values 
stored in my database.  I read through some of the previous posts -- is 
it true that they don''t work with integers?
This is the code I''m using:
<% for question in @survey.questions %>
  <%= debug question %>
  <%= radio_button ( "question", :question_id,
2008 May 11
3
radio_button_tag and default checked option
Hi, I can''t get my radio button to be checked by default, here is what I
have:
<%= f.radio_button :gender, "male", :checked => ''true'' %><p>Male</p>
<%= f.radio_button :gender, "female" %><p>Female</p>
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received
2010 May 19
1
Cannot have both select and radio_button together on the same form
Hello, I''m new to Ruby on Rails.
I am creating a form for searching purpose:
<% form_for :src_cond,
      :url => {:action =>''search''} do |p| %>
     <%= p.radio_button("bd", "1") %> a
     <%= p.radio_button("bd", "2") %> b
     <%= p.select :bd2, %w[1 2 3 4],{},{:index=>nil} %>
     <%=
2004 Oct 08
1
Encoding questions...
Since the sample rate and bit depth of each frame can be encoded in
the frame header, does this imply that the sample rate and bit depth
can vary from frame-to-frame, or this information purely for
stream-decoding purposes?
If the former, the reference encoder does not support this
functionality, correct? (Since you have to specify these values before
initializing the encoder).
Also, can I call
2006 Jan 04
4
radio_button method does not recognize int values?
So the api listing says that radio_button(object, method, tag_value, 
options = {}) gives a radio button tag, and if object.method == 
tag_value, then the button will be checked.
I verified the method behaves correctly for attributes of type string. 
However, if the attribute is of type int, it doesn''t make the button 
checked.
Does anyone have some information before I file a bug?
Some
2006 Aug 04
2
observe_field for radio_button
Hi,
I need to observe a set of radio buttons but am having great trouble. My 
observe_field looks like this:
<%= observe_field :user_select, :frequency => 0, :url => { :action => 
:admin_control } %>
Now it works fine if I use a text_field like this:
<%= text_field :user, :select, "size" => 20, "maxlength" => 16 %>
But I want a radio button, and
2011 Aug 09
4
Nesting select and text_field in radio_button
I''m creating my first Rails app and need an idea creating forms.
I have Meeting model with place attribute.
I want to have two fields for Meeting.place = one would be select with
places from other meetings or text_field if the place is being used
first time. User would be selecting radio_button of which field he has
used.
So is there any way to nest select and text_field within 2
2005 Dec 27
2
Rewriting FormBuilder
Hi,
I want to extend formbuilder to make it output a lable (I know about 
labeled_form_helper made by technoweenie), my own formating, and a 
couple of extra tags inside the form attribute. I was easily able to 
extend form_remote_to. But when I continue to adjust the way elements 
are handled I don''t know how to continue. I can''t find the method 
text_field thats should is
2005 Mar 07
2
Problem with Rails 0.10.1
I''ve got a view template that contains this:
  <%= render_component(:controller => ''reviews'',
                       :action => ''show'',
                       :params => { ''id'' => review.id })
  %>
In Rails 0.10.0 this worked just fine. After I upgraded to 0.10.1 I get this
error:
 ActiveRecord::RecordNotFound in
2006 Jul 06
0
radio_button with boolean fields does not work with postgresql
I don''t know what I am doing wrong. I have a User class with a
"send_message_emails" boolean field. The value for this is true. In
postgresql this is stored as a "t" in the database. In Rails this field is a
boolean and is set to true, but for some reason the following code is *not*
working... the radio_button is not selected.
<%= radio_button "user",
2006 Apr 04
0
radio_button in a loop not working
Hi!
I''m a RoR newbie and i''m trying to make this sample code work...
I must be able to choose whether or not to switch lights on/off (one 
light per line)
<table>
<% @valeurs.each do |@v| %>
	<tr>
	   <td>Light <%= Light.find(@v.light_id).nom %>:</td>
	   <td><%= radio_button(''v[]'', ''etat'',
2006 Apr 06
1
Puzzled by "radio_button".
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
2005 Mar 04
3
Need volunteer for cool RubyForge add-on
You''ve probably been reading the ruby-talk thread I started titled "RAA
Status & The Problem with Ruby" that rehashes that age-old conversation we
keep having about how to tell the good from the bad when it comes to ruby
libs and apps.
We now have an opportunity to stop talking about it and actually do
something.
I proposed a RubyForge add-on to create a user-driven
2008 Mar 23
1
radio buttons - how to identify record using value?
I''m making a simple questionnaire app using RoR. I''ve got a model for
Questions, a model for Answers, and a third model, Qa, for matching each
question to five possible answers through foreign keys. So, each qa has
a question and five answers , a1-a5, through belongs_to and a
:foreign_key, and then a selected_answer field for specifying which
answer was selected by the user. The
2006 Jul 26
0
radio_button groups
For my first rails app, I''m building a web page that will list some 
restaurants and then have the user rate them from from 1 to 5 using 5 
radio buttons.  The view code looks like:
<h3>Ratings:</h3>
<form action="save_ratings" method="post">
  <table>
    <tr>
      <th>Restaurant</th>
      <% for rating_option in
2006 Jun 21
5
newbie - question on radio_buttons
I have a view with a form and i want to be able to process the button 
selected in a controller - not sure how to do this. The form does not 
map directly to a model - all I want to do is be able to pass back the 
selected button and know which one it is.
So, i have a form and several radio buttons - the submit (not shown) 
takes me to the process_answer action where I want to determine which