Displaying 20 results from an estimated 1000 matches similar to: "radio_button_tag quirkiness..."
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,
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
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
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
2008 Aug 21
4
radio_button_tag - examining the selected value
Hi All
I have four radio buttons created like this
<%= radio_button_tag :answers, 1, false %> a <br/>
<%= radio_button_tag :answers, 2, false %> b <br/>
<%= radio_button_tag :answers, 3, false %> c <br/>
<%= radio_button_tag :answers, 4, false %> d <br/>
And then I have a link_to tag to invoke a controller function
2006 Jun 28
3
observe_field and radio button... does not work?
I try to catch click event on radio button, but nothing is executed....
Tested with RoR 1.1.2 and 1.1.3. What am I doing wrong?
<%= radio_button_tag(:city, ''Dublin'') %>
<%= observe_field(:citi, :frequency => 0.5,
:on => ''click'',
:with => "''city='' +
2007 Oct 11
3
radio_button_tag
Hello
I have a view which have 2 radio buttons :
...
<td style="width:5%">Actuel</td>
<td style="width:10%"><%= radio_button_tag(:actuel, value = "1", checked
= false, options = {}) %>
<td style="width:5%">Last</td>
<td style="width:10%"><%= radio_button_tag(:last, value = "1", 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,
2010 Jan 23
0
Problems with :onchange for radio_button_tag
Greetings,
I''ve been hitting my head to the wall over this for quite a while now
and don''t seem to be able to wrap my forementioned head around it.
Basically I have a list of users in a selection box and I have two radio
buttons: Sort by first name and sort by last name. This is what I have
in my view:
<%= radio_button_tag ''sort_by_last_name'',
2012 Apr 18
2
RoR - Search Forms with Checkboxes, display appropriate results
I have a form that allows me to search a hotel by city or name and by
rating through radio buttons. It all works.
However, my hotel model has_one :facility, this facility model is
composed by several boolean fields (for example, roomservice:boolean
restaurant:boolean and so on)
The question is, I want to add checkbox fields for each facility I have
and in the search form, when the user selects
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
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 Mar 24
1
Radio Button Tag and hash @Params.
Hi,
I''ve a little problem using the Radio Button Tag.
I use the " @prove=MODEL.column_names() " to keep attribute names of a
table. After
i used this code to select a attribute subsets of them :
<% i=''0''%>
<% for @obj in @prove %>
<% @key='':key''+i%>
<%= radio_button_tag (@key,@obj) %>
<%
2007 Feb 03
7
Interesting radio button behavior with "onclick"
Hello:
I have radio buttons like this:
<% fields_for :goalhist do |g| %>
<table>
<tr>
<td align=left><%= radio_button_tag (''duedate'', 0, checked = false,
options = {:onclick => ""}) %>
Start now
</td>
</tr>
<tr id="detailed" style="display: none"><td colspan=2>
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} %>
<%=
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 have option #3 be selected if foo.bar_id is nil. Is
there a way to do
2011 Nov 20
3
Use Ransack with radio buttons for boolean values
Hello
I''m trying to search for active and non active users. 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
=
2011 Jul 11
2
Pre-populating association
Hello,
I think this is an easy one for the average Rails developer but I''m a bit stuck.
I''m creating a simple voting app: any user can create a survey, with any number of questions, and other users can then vote by creating a ballot for that survey.
Here''s the modeling:
class Survey < ActiveRecord::Base
has_many :questions
has_many :eligibilities
has_many
2008 Apr 09
3
form_tag and form_for cause #protect_from_forgery errors
Hey All,
I''m trying to do a simple form_for (and I also get it with form_tag)
and I''m getting the following error:
ActionView::TemplateError (No :secret given to the
#protect_from_forgery call. Set that or use a session store capable
of generating its own keys (Cookie Session Store).) on line #2 of
users/new.fbml.erb:
1: <h1>Welcome To Courses, Let''s Get
2006 Apr 03
3
render :partial + redirect_to :controller
This is of course disallowed, which I discovered only after nearly
completing my spanking new ajaxified UI. What is the motivation behind
this, and what is the best workaround?
This UI does a scriptaculous drag-and-drop of items from a first div
(div1) over to a second div (div2), which triggers the contents of div2
to be updated to reflect the drop. No prob, thus far. But then the