similar to: Dynamically add radio buttons to forms?

Displaying 20 results from an estimated 3000 matches similar to: "Dynamically add radio buttons to forms?"

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
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
2009 Aug 04
6
form_for
hi everybody... I have a form_for in that, onclicking submit button i am calling a javascript for validation.If validation fails that form_for doesnt do anything.But even the validation fails it goes to the controller and action. here my code: <%form_for :promotion_code,
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
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 =
2009 Apr 28
0
Radio buttons in forms
<% form_for @group do |g| %> To create a new group please complete the details below <p> <label> Group Name </label> <%= g.text_field :name %> </p> <p> <label> Public </label> <%= g.radio_button :type, "public" %> <label> Private </label> <%=
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
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
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
2010 Aug 23
3
Unable to upload images using native rails file upload
I am a rails newbie and am trying to build my first app. I have a jobs and categories controller and models respectively. CONTROLLER: def new @job = Job.new @catergory = Catergory.all respond_to do |format| format.html # new.html.erb format.xml { render :xml => @job } end end #THIS IS A group of 10 RADIO_BUTTONS TO SELECT A CATEGORY FROM. BY DEFAULT THE FIRST
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} %> <%=
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
2006 Mar 10
0
Multiple radio buttons for defining multiple objects?
Hi, I''ve been working on a multiple choice Question/Answer system. The response object (analagous to a lineitem) has a question_id, user_id, and the actual response. What''s a good way of making a form with multiple response objects which are created from the radio_button helper? Right now I''ve got the following code:
2007 Jan 31
0
radio buttons => What if the value is a FK?
Hi: I have radio buttons like this in my view: <%= radio_button :goals, :goaltype_id, ''Recurring'', { :onclick => "new Effect.SlideDown(''recurring''); return false;" } %>&nbsp;&nbsp;Recurring<br /> <%= radio_button :goals, :goaltype_id, ''One-time'', { :onclick => "new
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
2007 Sep 14
2
how to use options in radio botton
Hi I am using radio botton,I am struggling to use options..following is my code.. <%= radio_button(''community'',''default'',0,options={:checked,:onClick=>"javascript:set_default(this);"})%> If i am using without checked option its working fine.If i use that its throwing error.... Please help me -- Posted via http://www.ruby-forum.com/.
2006 Mar 17
5
Radio Button Validation
I''m writing a quiz application and I need to validate the radio button reponses. I do not have the questions in a database, I just have forms which contain "question1" and then I strip out the "question" portion and just insert the number as the question''s id. So now I''m faced with the dilemma of making sure the radio buttons are pressed. Radio
2013 Oct 30
3
Use of FCKEDITOR as normal text area
Hi all I am trying to use Fckeditor as text area to send mails.here is my code <% remote_form_for :send_sms, :before => "Element.show(''loader'')", :success => "Element.hide(''loader'')" do |sms| %> <div id="news_content_text_field_bg"> <%= fckeditor_textarea :send_sms, :message,:lang =>
2006 Oct 13
2
form_for() and name
how can i give name attributes for form_for(), so it will give an output like <form name="f">. it is because that i need to access the form name for javascript manipulation. as far as i know, name can only used in form_tag(), but i currently have more than 50 forms that built using form_for(). the structure is like this: <% form_for symbol, item, :url => { :action