Displaying 20 results from an estimated 3000 matches similar to: "Displaying validates_acceptance_of Errors In A Check Box"
2006 Apr 07
0
validates_acceptance_of problem
I''m having some difficulties getting validates_acceptance_of to work.
No matter whether I tick the checkbox for my terms and conditions on
my form, it will not submit it and shows my error message.
in my model i have:
validates_acceptance_of :agree_to_terms, :message => ""
in my view i have:
<%= error_message_on :user, :agree_to_terms, "You must agree to the
2006 Apr 27
1
validates_acceptance_of, virtual attributes and mass assign
Hi,
I''ve a question concerning validates_acceptance_of method.
Documentation says that the validated attribute is a virtual one,
without a field in db. But when I add such an attribute to my form (say
check_box(:xyz, :agreement)), it''s passed in params[:xyz][:agreement],
but not assigned when calling Xyz.new(params[:xyz]), probably because
corresponding field
2007 Aug 21
2
validates_acceptance_of (and hidden input)
Hi
Why does a failed "validates_acceptance_of" create a hidden input in
the view?
cheers, jason
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this
2006 Jul 21
1
validates_acceptance_of weirdness
On my registration form I have a checkbox for a waiver. In the model I
have the statement:
validates_acceptance_of :waiver, :on => :create, :message => "must be
accepted"
In the view:
<%= check_box_tag("waiver") %>
<%= error_message_on "user", "waiver", "Waiver "%>
For some reason validate is accepting everything when the
2006 Feb 08
5
validates_acceptance_of + functional testing
I had to add a check box indicating that a user accepted certain terms
to a page. So, I put in a ''validates_acceptance_of :terms'' line into
the appropriate model and added a checkbox to my view. Everything
works as expected in my web browser.
However, my functional tests still pass and I didn''t add or change
anything to them. I was expecting to have to add another
2006 May 07
2
label tag with errors?
I''d like to create a label tag that has a special css class if has errors.
So Ideally, I''d like:
<%= label(''object'',''property'',''Property'') %>
To generate:
<label for="object_property">Property</label>
And if there are errors on object.property, generate this:
<label
2007 Nov 27
1
O/T div.fieldWithErrors styling
this is kinda trivial but I''m anal and it bugs me :)
whenever there''s a error in the form the error field is wrapped with
<div class="fieldWithErrors"> </div>
this throws my form''s styling off because it puts too much space b/t
fields and worse makes the form as wide as possible. How do I fix
this? I''ve tried
div.fieldWithErrors {
2007 Nov 13
0
Allowing validates_acceptance_of to store value on the database column
I''ve reopened a ticket for this and provided a patch withs tests. From
my notes on the ticket:
> An example use case here, is that I want to use the current version
of the EULA as the :accept value, and store that column, so I can
refer to the explicit version the user accepted at a later date.
http://dev.rubyonrails.org/ticket/7457
Any feedback and/or support for the patch is
2005 Aug 19
1
css style fieldWithErrors when using tables
I''ve run across something that I''m not sure how to fix. This is with
MSIE, Firefox doesn''t seem to have the same problem.
When rails displays form fields in error using the css element
fieldWithErrors, and the form field is enclosed in a table data tag,
the entire background of the table data element is set to red instead
of just the border of the form element.
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 Jul 12
0
Give form elements "fieldWithErrors" class in non-std. way?
All,
I want to know how to force an element of my model to be invalid, but
not generate any message for it, so that the corresponding form field on
a form will show up with the ''fieldWithErrors'' class.
I have some checkboxes on my RHTML form, and they are generated with
this code
<%= check_box_tag("current_job[target_list_ids][]"...etc. %>
target_list_ids
2007 Jan 13
1
fieldWithErrors - does not work
What conditions must be met for ''fieldWithErrors'' automatic wrapping?
<% remote_form_for( :subscriber,
:update => ''subscription'',
:url => {:controller => ''subscribers'', :action =>
''subscribe''}
) do |form| %>
<p>
<%= form.text_field
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,
2006 Jul 18
1
updating boolean field in model from check box value
hello
i am having a bit of trouble with updating the values of a boolean field
in my database/model given the value returned by a check box
i am generating the check box as follows:
check_box("user", "enabled")
which produces
<input checked="checked" id="user_enabled" name="user[enabled]"
type="checkbox" value="1"
2006 Aug 02
3
Disabling Error Divs
I am trying to figure out how to disable the error field thing in rails,
the thing that wraps errous fields with a div (class fieldWithError).
Any help on this would be great!
-Ray
--
Posted via http://www.ruby-forum.com/.
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 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.
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 May 02
3
Route problem
I have an index.rhtml is rendered when the (main)controller is loaded.
The page contains some check boxes and a submit button. See form code
below. When I click the submit button, I get a 404. I don''t know how to
post this data back to my controller where method "addvisit" is waiting.
It works in WEBrick no problem, but doesn''t work in fcgi on DreamHost.
I am
2006 Apr 09
12
Validating two models from one form
Howdy,
I''m working on my first RoR project, and I want to build a form. The
tricky thing is, this form needs to insert / update against two models,
each with their own validation rules. Unfortunately, I''m having an
incredible amount of difficulty with the error handling, specifically
the fields wrapped in <div class=''fieldWithErrors''></div>