Displaying 20 results from an estimated 4000 matches similar to: "validates_acceptance_of + functional testing"
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
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 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
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 Jan 24
5
simple formmail question
I have a few forms that I''d like users to fill out. The results of
the form will be sent to a few addresses.
What''s the least painless way to do this and keep everything DRY?
There''s no database involved. Ideally, I''d like to email the form
questions with the answers inline.
Seems like using ActionMailer and separate email views would be
overkill in this
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
2005 Sep 18
5
NameError: uninitialized constant Addres
I created some scaffolding for an Address model and an Addresses controller.
When running the functional tests for the addresses controller, I get
this exception: "NameError: uninitialized constant Addres"
The exception seems to start from this function:
def list
@address_pages, @addresses = paginate :address, :per_page => 10
end
I''m guessing pluralization bug?
2006 Jan 14
11
accessing models from migrations
Ok, so now Users need to be associated with Organizations. I''ve
created a migration and added a ''organization_id'' column to the users
table. I want the default organization_id to be the first
Organization. So I have :default => Organization.find(:first). But
it''s complaining about not being able to find the constant
''Organization''.
Any
2005 Mar 10
6
images from database + caching
Is the information in
http://wiki.rubyonrails.com/rails/show/HowtoUploadFiles on caching
images still the best way on how to cache images that are served from
the database?
I haven''t added time information to my image table yet, and the images
are sent after every single page view (even if it''s been downloaded
already).
Joe
2006 Jul 02
5
"the number of parameters does not match the number of substitutions" error
All of a sudden, I''m getting this error:
1) Error:
test_index(AccountControllerTest):
RuntimeError: The number of parameters does not match the number of
substitutions.
/home/joe/projects/tanga/trunk/config/../vendor/rails/actionpack/lib/action_controller/assertions.rb:92:in
`assert_redirected_to''
2006 Jun 12
2
Validating a non-object attribute in a form via checkbox?
Hi there
A user can place an ad with various attributes via a form; however, I
want the user to check a box signifying that they''ve read the terms
and conditions for use of the site.
So the ''terms'' is not an attribute of the Advertisement model. I
could check that the user has ticked the box in my controller but
would like to bundle this up with the validation
2005 Mar 09
16
rails on low memory vps
Anyone got any tips for running Rails (w/ either webrick or
lighttpd/fcgi) on a VPS with a pretty small amount of memory (like
64MB memory and 64MB swap).
Thanks,
Joe
2007 Sep 28
6
Couple questions about backgroundrb
So, what''s the status of this project? I''m a little confused. The
documentation at http://backgroundrb.rubyforge.org seems out of date.
It refers to http://svn.devjavu.com/backgroundrb/tags/release-0.2.1,
which doesn''t work.
All I want is a way to easily set up tasks that should run
periodically. Some stuff should run every 10 seconds, some stuff once
a day, etc.
2006 Mar 15
10
Question on hardware for site
For a medium-sized website, does one machine for database server
(either mysql or postgres) and another for the web server (lighttpd)
sound ok? How much traffic could I expect to handle? (I know it
depends on the application, but some rough estimates would be nice)
Joe
2006 Jun 29
6
adding a before_filter to static content
Hi,
I have a Rails site that uses a before_filter in the application
controller that does some authentication and authorization work.
I also have a bunch of HTML in folders in the application''s public directory.
Before a user can view anything in the public directory, I''d like to
authenticate them. How could I do that?
I''m using mongrel, if it matters.
Thanks,
Joe
2005 Mar 16
6
caches_page problem
I''m currently caches_page the show method in my Image controller. The
show method looks at @params[''id''] to determine what output should be
generated.
The first time I access the method, say with
http://localhost/public/image/show/1.jpg, the appropriate directories
get created in /public (i.e. public/image/show/1.jpg). However, when
I try to retrieve
2006 Aug 04
9
Mongril or Lighthttttp? Yes
I was writing my blob at http://railsblob.blogspot.com/ which is for new
people who are new to Rubby and I was learning if Mongril or
Lighthttttp? or Web Rick is better for me. Have you any advice. Thanks?
Rails Blobber
--
Posted via http://www.ruby-forum.com/.
2007 Aug 16
3
Mocking a non-existent method
I don''t like this:
i = mock(Integer)
i.should_receive(:asdfasdf).and_return(''foo'')
puts i.asdfasdf
Shouldn''t rspec check to see that :asdfasdf is a valid message to be
sending Integer?
Joe
2007 Jun 09
2
mystery problem with svn post-commit script running rspec tests
So, just spent seven straight hours on this.
I have a post-commit svn script that runs all my tests. Emails me if
something goes wrong.
One of the lines looks like:
@output = `rake test RAILS_ENV=test`
The output from the rspec tests don''t seem to appear in @output. Why
would that be? Oddly enough, that only seems to happen when the
script is ran from svn''s post-commit
2006 Aug 16
3
gems vs plugins
Hi,
Is there an easy way of converting a gem to a plugin, or at least
something you can dump into $RAILS_ROOT/vendor?
I''m uncomfortable having stuff like capistrano, the shipping gem,
builder, autotest being installed globally as a gem instead of being
installed for each application.
What do you think?
Joe