Displaying 20 results from an estimated 10000 matches similar to: "updating boolean field in model from check box value"
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
2009 Oct 06
1
Problems Processing multiple form elements generated by javascript actions
Hi all,
After many days of struggling, I have a multi-model form with ajax
elements more or less working, but I''m hitting a wall with a few bugs
that I can''t figure out. Guidance would be very much appreciated.
I''m using the Ryan Bates technique from Advanced Rails recipes to
dynamically add and remove elements on a multi-model form.
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 Apr 10
3
Problems with multiple ActiveRecords and Validations
Hi all,
I am a RoR newbie and have the following scenario set up:
There are 2 ActiveRecords involved, the first one being "User", the
second one being "Visibility".
The corresponding users table holds address informations regarding a
User. The visibilities table holds visibility settings for the
individual columns of the users table (i.e. firstname, lastname, country
2006 Feb 05
1
Check/uncheck all checkboxes
Hello!
I have this page where I list all users in a table. There is checkbox in
every row. My User-model has a "checked"-attribute.
I have implemented the checkboxes like this:
<%= check_box("user[]", "checked") %>
Which outputs this:
<input id="user_12_checked" name="user[12][checked]" type="checkbox"
value="1"
2006 Nov 04
0
Check_box woes
I have a User model and an Address model.
A user has_many addresses, and an address belongs_to a user.
An address object for a user could be a billing, shipping or marketing address.
The way I''m tracking this is via the 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
2006 Feb 25
1
checkbox helper question
I used scaffolding, then modified. As an after thought I added a
"boolean" checkbox to my database, form with this tag
<p>
<%= check_box ''is_hot_item'', @photo.is_hot_item %>
<label for="is_hot_item">hot item?</label><br>
</p>
I check it and save. But I don''t get 1 saved in my database field.
:(
I have just the
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 Feb 16
5
filter a list
I''d like to add some filter choices to display a list of items. These
items has some boolean fields for example, and would like to have a
checkbox at the top of the window to let me select how to filter the
list.
here''s what i put in my controller
if @params[:filter].nil?
@params[:filter] = { ''sent'' => "1"}
end
... generate the corresponding
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
2006 May 05
0
is this good for a conditional checkbox?
i''m pretty new to RoR and the MVC style of programming in general. i
have one page with a list of applications that several users can
access. in my view, i have a conditional that decides whether the
checkbox is checked or unchecked. being new to this, i just did it the
only way i could think of and want to see if there''s a better way of
accomplishing it.
<%
2006 Oct 04
0
Displaying validates_acceptance_of Errors In A Check Box
Hello,
I am having trouble displaying a check box which must be checked but
hasn''t been. I would like it to be highlighted as in a scaffolded
view but the hidden check box field which is generated by the
check_box helper is also highlighted, and the text next to it loses
its styling.
My code follows. Should I get cleverer with the CSS or write my own
check_box helper which
2008 Feb 28
1
Inheritable Permissions Issue
I have a Centos 3 server running Samba 3.0.28. It's a member of an AD
domain on a Windows Server 2003 R2 Standard x64 SP2 box. From the
W2K3 server I can see the samba share I created. Using the Security
tab in the Windows Explorer file properties dialog I can add and
remove users and change their permissions. However, in the
Permissions tab of the Advanced Security Settings dialog,
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 17
19
updating model
hello,
i am writing a simple user login system.
when registering a user account, i have two field:
password
password_confirmation
which are validated using
validates_presence_of
validates_confirmation_of
and these are then used to generate a password hash which is stored in
my database
when i want to update the record (without changing the password and
entering new values for password and
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 Oct 16
3
Saving many_to_many
Ahoy, i''m trying to save a many to many between "talent" and "vital
stat"
talent_controller.rb
def edit
@talent = Talent.find(params[:id], :include => [:talent_type,
:vital_stats])
@talent_types = TalentType.find_all
@vital_stats = VitalStat.find_all
if request.post?
@talent.attributes = params[:talent]
@talent.attributes =
2006 Apr 21
0
checkbox with has_many
Hi,
How do I set up a checkbox to use a record with a has_many field?
For example, say I have a User which is an Active Record Model. And
say it has many names.
class User < ActiveRecord::Base
has_many :names
end
class Name < ActiveRecord::Base
belongs_to :user
end
Say I want to update this user and I want checkboxes that give a
choice between different names. How would I do that?
2006 Aug 11
1
how is form data sent to the conntroller?
I''m trying to implement a bunch of checkboxes whose value I need to use
to process more code without updating the db.
This is my code to for the checkbox in my view
input type=checkbox id=<%=search.name%>_selected
name=<%=search.name%>[selected]>
I guess my question is, when I''m back in the controller, how do I get at
the actual value (checked or unchecked)? It
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