Displaying 20 results from an estimated 63 matches for "radio_button".
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 with the 1st radio_button, i...
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...
2006 Jul 06
0
radio_button with boolean fields does not work with postgresql
...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", "send_message_emails", ''true'' %>
I have tried all of the following combinations and none of them have worked:
<%= radio_button "user", "send_message_emails", ''true'' %>...
2005 Mar 07
2
radio_button helper and "checked" option
Does anyone know how to get the radio_button helper to set the html
"checked" option?
Thanks,
Curt
2008 Jul 02
3
attachment in mail
How to do the attachment in mail like the yahoo and gmail does?
--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
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....
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,
B...
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} %>
<%= p.submit "Search" %>
<% end %>
When I click "Search", the browser shows:
"We'...
2006 Apr 04
0
radio_button in a loop not working
...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'', "Off") %> Off</td>
<td><%= radio_button(''v[]'', ''etat'', "On") %> On</td>
<td>Intensite :<%= text_field(''v[]'', ''intensite&...
2008 Mar 23
1
radio buttons - how to identify record using value?
...to and a
:foreign_key, and then a selected_answer field for specifying which
answer was selected by the user. The selected_answer is also an Answer
through a foreign key.
Here''s the question: What do I use for the value of the radio button?
I''ve tried the following:
<%= f.radio_button :selected_answer, :a1 %><%= @qa.a1.answer_src %>
<br />
<%= f.radio_button :selected_answer, :a2 %><%= @qa.a2.answer_src %>
<br />
<%= f.radio_button :selected_answer, :a3 %><%= @qa.a3.answer_src %>
<br />
<%= f.radio_but...
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 />
<%= radio_button("user", "enable_report", "no") %><label for="no">
No</label><br /></p>
</fi...
2006 Aug 04
2
observe_field for radio_button
...ld :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 what I have is this:
<%= radio_button("user", "select", user.id) %>
The above doesn''t work and neither does:
<%= radio_button_tag("admin", "select", user.id) %>
----------
I ahve no clue why the radio buttons don''t work with the observer. Any
help would be greatly...
2011 Nov 20
3
Use Ransack with radio buttons for boolean values
...sers. These radio buttons
work just fine except that it didn''t reselect itself after the form has
been submitted. So, what should I do to ensure it will be selected just
like how my text field populated automatically after the form has been
submitted?
= search_form_for @q do |f|
= f.radio_button :is_active_false, 1
= f.radio_button :is_active_true, 1
Thanks in advance.
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/LKxcEyGf-2M...
2011 Jul 11
2
Pre-populating association
....html.erb page, I try this:
<%= form_for [@survey, @ballot] do |f| %>
<%= f.fields_for :preferences do |preference_form| %>
<%= preference_form.fields_for :question do |question_form| %>
<p>
<%= question_form.label :question %><br />
<%= radio_button("preference", "preference", "Yes") %> Yes
<%= radio_button("preference", "preference", "No") %> No
<%= radio_button("preference", "preference", "Decline") %> Decline
</p>...
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
radio_buttons?
I would appreciate any other solution ideas too.
Cheers
--
Posted via http://www.ruby-forum.com/.
--
You received this message because you are subscribed to the Google Groups "Ruby on Ra...
2006 Jun 21
5
newbie - question on radio_buttons
...ass 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
button was pressed
<%= start_form_tag(:action => "process_answer") %>
....
<%= radio_button "radio", "answer", "a" %> (A)
inside the process_answer, I have the following:
def process_answer
if params[:answer] == "c"
redirect_to(:action => "correct_answer")
end
end
it does not like this
any thoughts??
Seamus
--
Poste...
2006 Jul 26
0
radio_button groups
...lt;%=h rating_option.to_s -%></th>
<% end -%>
</tr>
<% for user_rating in @ratings -%>
<tr>
<td><%=h user_rating.restaurant.name -%>: </td>
<% for rating_option in [1,2,3,4,5] -%>
<td><%= radio_button(:user_rating, :rating, rating_option)
-%></td>
<% end -%>
</tr>
<% end -%>
</table>
<input type="submit" value="Save">
</form>
Where @ratings contains an array of objects from find(:all), and I want
to assign...
2009 Aug 04
6
form_for
...m_for doesnt do
anything.But even the validation fails it goes to the controller and
action.
here my code:
<%form_for :promotion_code,
:url=>{:controller=>"home",:action=>"create",:discount_id=>product.discount.id,:id=>@ad.id}
do |f|%>
<%=f.radio_button :isemail,"true",:checked=>true%><b>Email
</b>
<%=f.radio_button :isemail, "false"%><b>Sms</b>
<%=f.text_field :email_or_mobile,:size=>20%>
<%=f.submit "Generate", :onclick=>&qu...
2006 Apr 04
1
using form_remote_tag and radio_button
I want the user to select a date using radio buttons. The following
code shows the last 7 days.
<%= form_remote_tag(:update => ''register_order'',
:url => { :action => :register_orders } ) %>
<% 1.upto(7) do |i| %>
<%= radio_button "date", "register_date", i.days.ago.strftime("%Y-%m-%d") %>
<%= i.days.ago.strftime("%Y-%m-%d") %>
<br />
<% end %>
<br />
<%= submit_tag "Register" %>
<%= end_form_tag %>
<div id=&q...
2006 Mar 22
2
Radio Button Defailt Value?
I have:
<%= radio_button ''foo'', ''bar_id'', ''1'' %>
<%= radio_button ''foo'', ''bar_id'', ''2'' %>
<%= radio_button ''foo'', ''bar_id'', ''3'' %>
I would like to...