similar to: Using conditions appropriately

Displaying 20 results from an estimated 2000 matches similar to: "Using conditions appropriately"

2006 Jan 07
1
level sets of factors are different
Hi, I have two data frames A en B. I want to filter B with values of A data_frame_b names <- colnames(data_frame_b[1:1, ]) filtera <- data.frame(data_frame_a[1:1]) print(nrow(filtera)) if (nrow(filtera)>0){ filtered_frame_b <- subset(data_frame_b, ColumnX == filtera[1, 1], names) } The results are: [1] 124 Error in Ops.factor(ColumnX, filtera[1, 1]) :
2006 Jun 20
6
checkbox_tag outside a form?
Is it possible to use checkbox_tag outside a form? I''ve put it in a view and it renders but I get nothing back in the params hash. Is there a way to get the value? Like maybe with some JS onsubmit to populate the params hash myself? Thanks, Bill -------------- next part -------------- An HTML attachment was scrubbed... URL:
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
2009 Mar 18
4
Search Results into new table
I have a search form on my rails site. once the a user has entered a query it displays the results in a table with an extra field button so it can be added to there own portfolio called add to my stocks. How do i get the data for the stock they want to add and put this into a new table called mystocks. Is using a form submit button the right choice? Any examples much appreciated Regards Nick
2007 May 25
3
check box value in array
Hi guys, I have a group of check box in rails page. check box Code as below: <% for count in @total_cellno %> <input name="checkbox" type="checkbox" value="<%= count %>" /> <% end %> I want to receive the selected value in my controller model. @selected_box << params["checkbox"] I guess that it provides values
2011 May 30
5
rails habtm checkboxes with jquerymobile
Hi guys, I have a habtm association working properly. My application consists of both a desktop and a mobile version. My mobile version is made with jquerymobile and I would like my checkboxes in the edit form to look like the checkboxes shown in http://jquerymobile.com/demos/1.0a4.1/#docs/forms/forms-checkboxes.html. My desktop code is the following: <%= check_box_tag
2005 Dec 21
3
Checkbox readonly
I declare some checkboxes : <%= check_box_tag ''offers[]'', offer.id , @params[:offers].include?(offer.id.to_s) ,:readonly=>true %> the result is : <input checked="checked" id="offers[]" name="offers[]" readonly="readonly" type="checkbox" value="1" /> But readonly doesn''t work ??? -- Posted
2007 Dec 17
6
Checkbox array and Ajax.updater
Hello all, I have some checkbox array like these: <input type=checkbox name=list[] value="1">Java<br> <input type=checkbox name=list[] value="2">JavaScript<br> <input type=checkbox name=list[] value="3">ASP<br> <input type=checkbox name=list[] value="4">HTML<br> <input type=checkbox name=list[]
2006 Apr 04
6
check_box_tag is limited?
Hello all. Am I going totally nuts here and just want to check (Natch!) something. A normal check_box has two value posssibilities. One for checked and one for unchecked, the value gets submitted with a form. The check_box_tag on the other hand, has a checked_value (Called just ''value'') and for the unchecked value...nothing, zip, nada. This means that if you submit a form with
2006 Apr 24
4
javascript in RoR page - Check ALL/uncheck ALL buttons
I am trying to implement a check all and uncheck all button for my check boxes. Here is what I have below. I am getting this error each time: Error: document.myform.add_visit_for_this_Pt has no properties Source File: http://localhost:3000/AddPatientVisit/addvisits Line: 1 Strange that I can''t seem to pass value into the function. Thanks for your help! <SCRIPT
2006 Jul 03
9
checkboxes
in the mean time i am using a checkbox like this : <input type="checkbox" name="var[car]" <%= var.car ? ''checked'' : '''' unless @var == nil %> /> but i am sure there is something better than this in rails like <%= checkbox_tag ''var'', ''car'', :checked => true %> but this is not
2006 Jun 04
4
Multiple checkboxes
Please could someone suggest what might be wrong here. In my view I''m displaying a series of check boxes and when the form is submitted I want the controller to iterate over the values and contatenate them all into a string "1" if the box was checked and "0" if it wasn''t. I''m new to Ruby and Rails and I can''t seem to get any values out of
2006 May 11
3
multiple checkbox values, convert to string, 1 db field
Basically what I''m trying to do is create a way for users to enter "keywords" that will then be searchable. I.e., when a user creates a new Item, there is also a keywords field in the database that is a string like "purple triangle free" -- but all the user sees when they are creating the keywords is a series of checkboxes like: __blue __red __purple __circle
2009 Jun 28
1
CheckBox and Ruby on Rails
I have two questions: 1. I have a checkbox on a form and after submit I need to check the status of the checkbox. Any idea how to see what the checkbox is set to? I am assuming this must be done in the controller or model but cannot figure it out. 2. On load I am checking for a cookie and need to determine if the checkbox should be checked or unchecked. Is there a way for me to do this from
2008 Jan 08
1
HOWTO: Add a new line, Remove new line?
Hello everyone, I have a couple of checkboxes, where each checkbox belongs to a specific input field (which has a value). So whenever the user clicks on the checkbox, each value of the associated input field is added up and placed in the ''result'' ID. I''m using unobtrusive Javascript to make this happen... However I want to able to add and remove a new line (checkbox
2006 Apr 23
1
checkboxes for filtered search
I have a page that renders a series of about 20 checkboxes on the left hand side with content on the right. These checkboxes are created from a DB and that part is all working well. What I want to do is have a user click on a checkbox [genres] and have the content on the right be filtered based on the checkbox ticked. If a user clicks on more than one checkbox than only those stories
2011 Oct 21
20
How to transform my html form into a rails 3 form
Hi, I have the following code working in a rails 3 view, but it is unfortunately not pure rails code! <% @filter1 = "tr.show1,tr.show2" %> <% @filter2 = "tr.show1" %> <% @filter3 = "tr.show2" %> <form> <p> <input type="checkbox" value=<%=@filter1%> onclick="$ (this).is('':checked'')
2006 Jun 27
19
Event.observe
I''m not sure if I''m understanding this correctly. <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT"> Event.observe(''mes_appearance_s0'', ''onchange'', function(e){ alert(''changed me!'') }); Event.observe(''headinjury'', ''click'', function(e){
2007 Apr 16
6
How to use a form.check_box ?
Hey guys, I''m trying to have a simple webform in my administration section to add a user. I have the text_fields for adding the user''s name, password, and password confirmation, but cannot seem to figure out the checkbox. I want it to be a single checkbox, that if clicked, will set the database column "access" to be "admin" and if its unchecked, set it to be
2006 Apr 27
2
check_box_tag and :disabled => ''disabled'' problem
I''ve been using the check_box_tag to generate checkboxes for an application I am working on and I''ve run into a little hiccup. When I set the options for the checkbox to be { :disabled => "disabled" } the checkbox becomes disabled, as I would expect. However, if I set the checked value to true and keep the disabled option, the value for the checkbox is not returned.