similar to: Differences betwen check_box_tag and check_box form helper.

Displaying 20 results from an estimated 5000 matches similar to: "Differences betwen check_box_tag and check_box form helper."

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 Aug 10
2
check_box form helper questions/issues
I''m using Rails 1.1.x and it looks like the check_box form helper expects me to provide and object and method so it can determine if the checkbox should be checked or not. I''m having a couple of issues with this. note: I''m using UserEngine and adding a HABTM so that: class User < ActiveRecord::Base has_and_belongs_to_many :foos end class foo <
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
6
Howto: Check_box with a variable (no model)
Hi, I would like to put a checkbox on a form where the input field is a variable rather than a field in a model. The normal way (with a model) would be: <%= check_box(''client'', ''accept'', {}, "1", "0") %> But since accept is a variable @accept and model client will not be there, how do I make a check box work? Regards, Paul
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
2006 Oct 15
2
Getting check_box to default to checked?
I''ve tried this (in a new method/template -- so @type doesn''t actually exist yet): check_box ''type'', ''notify_on_create'', {:checked=>''true''} But :checked seems to get swallowed. I''ve also tried setting notify_on_create to true in the Type model, but that doesn''t work either. Any way to get the
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 Apr 18
2
check_box
I''ve got a question on the use of check_box. *** This is working but there just has to be a better way: RHTML: <% for book in @books do %> <tr> <td><%=book.label%></td> <td> <%checked = book.subscribed ? ''checked'': ''nope''%> <%=check_box("book" + book.id.to_s,
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
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 Jan 21
5
How do you deal with non-model property form values
I have a User ActiveRecord model that has email and password properties. I want to build a login for that has a "remember me" option. My view looks like this: <% @page_title = "Login" -%> <%= error_messages_for ''user'' %> <%= form_tag %> <table> <tr> <td align="right" width="1%"
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
2007 Dec 15
3
check_box not being checked
I''m new to RoR and I''m having a little problem that I can''t solve. My model is simple. I have Lists and ListItems. I have a view that loops through all the list items, and I put the HTML for the each list item row in a partial called _list_item.rhtml. This is the view, called show.rhtml <ul> <%= render(:partial => "list_item", :collection =>
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 Jun 16
2
image_select_tag with name and value
What have I missed I have a .rhtml with the sandard form parameters <%= image_submit_tag("excel.gif", :alt => "Download List to Excel", :border => 0, :name => ''render_action'', :value => ''excel'' ) %> Which genenerates I believe a valid html fragment for a submit button. <input alt="Download List to Excel"
2010 Nov 11
2
Rails 3 - Nested Forms, using Builder -- Check_box issue
Hello, I have the following: My Controller: def new . . @teammembers.each do |teammember| request = @request_thread.requests.build(:recipient_id => teammember.user_id, :full_name => ''Billy Bob T'') end My View: . . <%= f.fields_for :requests do |builder| %> <div class="field"> <%= builder.label
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
2007 Apr 30
0
check_box
I am sure this is a trivial problem for a rails guru! all I want to do is display an appropriately cheched check_box in a table, so: instead of <% for t in @patient.histories%> <tr> <td><%= t.ihd %></td> </tr> <%end%> I want something like: <% for t in @patient.histories%> <tr>
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/.
2006 Jun 07
5
check_box:how to update 2 checkboxes dependent on each other
I''ve got the following problem, I''ve created two check_boxes in my view. The user has to select one check_box, but isn''t allowed to seth both of them together on true. Now i am looking for functionality that can help me doing the folling: Scenario 1 CheckBox1 = True, The user sets CheckBox2 from False to True, now CheckBox1 should automatically become False.