similar to: check box tag binding between controller and the view

Displaying 20 results from an estimated 200 matches similar to: "check box tag binding between controller and the view"

2012 Oct 21
5
Error occured while evaluating nil
This is the code if !params[:ratings].nil? params[:ratings].each_key do |r| @selected_ratings << r @movies << Movie.where(''rating = :rating'', :rating => r) @sort = params[:sort] end elsif @selected_ratings = @all_ratings @movies = Movie.order(@sort) @sort = params[:sort] end This is the error You have a nil object
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
2007 Sep 15
3
check_box_tag always checked
#check_box and #check_box_tag are going to be the end of me. Why is this always checked? <% checked = @reservation.selected ? ''checked'' : nil %> <td><%= check_box_tag("reservation[" + @reservation.id.to_s + "][selected]", ''checked'', :checked => checked) %></td>
2006 Jul 19
3
How do I check the retuned value from check_box_tag?
Hi, I have this in my form <%= check_box_tag(@accept, value = "1", checked = false) %> Which puts a nice checkbox on my form but when I try to retrieve the value that is returned, which I expect to find in @accept, there is nothing. How do I check the returned value? Thanks, Paul Thompson
2006 Mar 24
2
check_box_tag
hi, What''s the right way to use the CHECK_BOX_TAG? I used: <% for @pippo in @model %> <%= check_box_tag (:scelta,@pippo) %> <% end %> How Can I control if a person choosen the second or third element of the vector @pippo? -- Posted via http://www.ruby-forum.com/.
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 May 03
1
Differences betwen check_box_tag and check_box form helper.
What is the difference between the check_box_tag and the check_box form helper? I can''t understand why both must exist. :( Thanks. Fernando Lujan
2008 Mar 02
2
check_box_tag remote_function
I have a collection of check_box_tags that look like the following: <% for item in @items %> <%= check_box_tag "item[item_ids][]", item.id, false, {:onchange => remote_function(:url => update_items_path, :with => "''items='' + escape(value) "} %> <%= item.name %> <% end %> My question is, how do I send all of the current
2006 Mar 27
0
how the check_box_tag works?
I don''t understand the right functionally of the Check_box_tag!. def check_box_tag(name, value = "1", checked = false, options = {}) can i put as value, the attribute names of a my model? I would select some model attribute to work. -- Posted via http://www.ruby-forum.com/.
2008 Jun 18
2
check_box_tag with instance variable
hi, i am trying to use one check_box with instance variable and trying to get true or false value from database table. and also please give me solution for multiple check_box and select all how to feed and retrieve value and show in check box. Thanks Purab -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are
2007 Mar 30
10
check_box_tag not passing 0 when unchecked?
Code: <%= check_box_tag("person[#{person.id}][is_approved]", 1, true) %> Rendered output: <input checked="checked" id="person[7][is_approved]" name="person[7][is_approved]" value="1" type="checkbox"> Problem: The value of "1" is always passed, even if the box is UNCHECKED. Suggestions? Thanks! -- Posted via
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
2008 Jan 31
3
Handling multiple Check boxes in a XHTML Strict way
Hi, The default way we handle an array of checkboxes is like this: <% items.each do |item| %> <%= check_box_tag ''item[]'', "#{item.id}" %> <% end -%> this returns an array item[] that holds the ids of all the items. Now the real issue: 1. The above loop will same ids to ''n'' items 2. All ids will be ''item[]''
2006 Apr 25
3
Simple Rails Question
Hi, I have a few simple rails questions: Does the check_box_tag map to an int or to a boolean field within the database? Thanks in advance, -Conrad -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060425/4956dc68/attachment.html
2011 Oct 18
0
check_box_tag call action on change (AJAX)
Hi all, I''m developing an application with Rails 3.0.9 and I have a checkbox and I want to call a function when it is checked/uchecked. I''m trying with: <%= check_box_tag "mylabel" t.to_s, false, { :onchange => remote_function( :url => { :action => ''update_preview'', :id => t.to_s })} %> in the "show" view and this in the
2006 Dec 02
1
document_id globally incrementing
Hi All I have made my xapian indexer automatically create new indexes once it reaches X documents in each, and for each document that I add to each sub-index, I record its document_id and its index_id (relating to what index the document ended up in). writabledatabase_add_document() returns document_id:s beginning from 0 for each new index when you add new documents, like you would expect. So
2006 Jul 11
4
checkboxes with a has_many :through relation
All, I''m populating a view with checkboxes in a list. I want to be able to assign to my has_many relationship using the post values of these checkboxes. Essentially, I want to populate the relationship table which will create the correct join values in my model. Here is my check_box_tag code: <%= check_box_tag("@current_job[target_list_ids][]",
2006 Aug 07
2
Getting an array of ids from form checkboxes?
Is it possible to set up a list of checkboxes so that the form parameters are given in an array (eg {"delete_list" => [3,6,7]}) ? At the moment I''m using <%= check_box_tag "delete_list[#{post.id}]" %> ...which gives parameters looking like {"delete_list" => {"3" => "1", "6" => "1",
2008 May 29
5
f.checkbox?
Okay so I have a typical search page where a keyword is entered and results are retrieved that match the keyword. What I want to do now is have checkboxes to search for results in specific areas (my site is a big events calendar with "streams" and "audiences") I want to use the checkboxes to look for results in ''streams'', ''audiences'', or
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.