search for: check_box

Displaying 20 results from an estimated 126 matches for "check_box".

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(&...
2007 Apr 16
6
How to use a form.check_box ?
...ation, 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 "user". This is what I have so far but nothing is rendering just because of the check_box line. <% form_for :user do |form| %> <p> <label for "user_name">Name:</label> <%= form.text_field :name %> </p> <p> <label for="user_password">Password:</label> <%= form.password_field :password %>...
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 automatical...
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 check_box to default...
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
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 a...
2010 Nov 11
2
Rails 3 - Nested Forms, using Builder -- Check_box issue
...st = @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 :full_name %> <%= builder.check_box :recipient_id, :checked => false %> </div> <% end %> . . The nested form for requests only holds the user_id, not the user.name... Problem is in the nested form, I need to show the user.name next to the check_box. So I tried adding a virtual attribute in the model (attr_accesso...
2006 May 03
2
disabled check_box does not work as expected?
I have a checkbox: <%= check_box(:day, :monday, {:disabled => ''''} , (day.monday == true ? {:checked => ''checked''} : {:checked => false} )) %> It is disabled allright, but it is always uncecked. Is this supposed to happen. It looks like (day.monday == true ? {:checked => '&...
2006 Nov 04
0
Check_box woes
...he user attributes: billing_adress_id, marketing_address_id and shipping_address_id in the user table, which holds the relevant address id. But in my form that allows a user to edit an address, including nominating it as a marketing, shipping or billing address, I''m getting stuck with the check_box helpers setting this up. Here''s my form (edit_address.rhtml -- you''ll see that I have some fields for both user and address objects in the form) <% form_for :address, :url => { :action => "edit_address" }, :html => {:id => ''account_form''...
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...
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
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
2006 May 02
10
Ruby on Rails w/Dreamhost - routes problem...I think.
I am trying to deploy my first app on Dreamhost using Ruby on Rails. I followed the wiki, but I think I am missing something. I think it may be in my RoR code, but I am not sure. My app runs fine when run as http://localhost:3000/AddPatientVisit/addvisits AddPatientVisit is the controller and addvisits is the form that posts back to the controller. I got rid of the index.html in public
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'', :che...
2009 Oct 06
1
Problems Processing multiple form elements generated by javascript actions
...d render correctly on the user#show page. So basically, the edit/update action is working perfectly and the creation of new schedules is not. The problem is really just the checkboxes because the market actually saves correctly. One solution I tried was to add something like the following to each check_box method, but this blew up the app: :index => (showing.new_record? ? '''' : nil). This is problem #1. Problem #2 is that when I click the "remove" link for a given schedule (i.e. a market and its 7 available checkboxes combination, and I hit update, the user_id and mark...
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
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 pa...
2007 Dec 15
3
check_box not being checked
...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 => @list.list_items) %> </ul> And this is the partial _list_item.rhtml <li> <%= check_box ''list_item'', ''done'' %> <%= list_item.text %> </li> As you can see, my list_item has two fields: done and text. The problem is that even though the field done is an integer "1" I can''t get the checkbox to get checked!!! The re...
2006 Jun 09
0
has_many / : through / check_box - update problems
...through each Territory and display a line which allows editing of the localdetails for that Movie for each Territory, something like... for territory in @territories localdetail=LocalDetail.find(:all, :conditions[''territory_id=? AND movie_id=?'',territory.id,@movie.id]) check_box(''movie[localdetail_id][]'',''will_be_shown_here'') end But I can''t find any form of syntax for the checkbox that will allow this to work. I think I''ve tried everything, but of course, you may know better... Any ideas ?
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> <td><%=check_box_tag"diabetes", t.ihd %><...