Displaying 20 results from an estimated 500 matches similar to: "Introspecting validates_presence_of"
2005 Dec 16
4
Validation with Aggregation
ActiveRecord supports composed_of for value objects which is
fantastic but one thing that it doesn''t seem to support (or at least
I am unable to find any documentation for) validation of the value
objects.
For example, given the following:
class Message < ActiveRecord::Base
composed_of :sender, :class_name => ''EmailAddress''
composed_of :recipient,
2006 May 18
1
Introspection of validates_presence_of
Hello all.
I don''t know how to get all symbols passed to method
validates_presence_of in model. I''ve trying to use following solution:
class News < ActiveRecord::Base
validates_presence_of :title, :text
def validates_presence_of(*attr_names)
@@obligatory_fields = attr_names
ActiveRecord::Base.validates_presence_of(*attr_names)
end
def obligatory_fields
2006 Aug 07
5
RJS Change Background Color
What''s the page.method to change the background color of a DOM element? I''m
trying to change the background color of a couple of styled <li>''s when an
Ajax link is clicked.
Thanks,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060807/63de04bf/attachment.html
2005 Apr 08
2
attr_names in test67
Hello,
I'm wondering if the following situation is valid (though I think it
isn't since I still cannot authenticate with ldap pass/userdb on
test67 running on FreeBSD-5.3).
Is it normal that the passdb_ldap_conn->attr_names second element (for
instance) "turns to" "homeDirectory" as the following step by step gdb
run sample shows ? :
--
Breakpoint 1,
2006 Jun 13
6
Dead horse: validates_associated
Regarding validates_associated...
Let''s say I have:
article belongs_to author
But for whatever reason, I want an article to also be written
anonymously and therefore not require an author. Then I have:
Article:
belongs_to :author
validates_associated :author
But I DON''T have validates_presence_of. What I want to do is validate
that an author is valid --if it is
2006 Jun 20
1
Possible to check if form field is required?
Hi list,
is it possible to check if form field will be required when form is
submitted (through validates_presence_of or some other validates_*
method)? I could do this manually but it doesn''t seems to me very DRY.
For example, I would like to be able to dynamically add asterisk with
some helper method if city is required here:
City*: <%= text_field
2005 Apr 12
1
test67 ldap_connection
Hello,
I've been trying to figure out what's wrong with authentication
against an ldap pass/user db with test67 as test62 was working fine.
[ The problem is the same as previously described in this list :
- FreeBSD-5.3
- dovecot-1.0-test67
- openldap-2.1.27
--> "ldap(dovetest,127.0.0.1): No password in reply"
--> "NO Temporary authentication failure."
or
--
2006 Jan 26
21
pagination_links help
I want append custom query parameters to my pagination links, like
?page=1&foo=bar. I can''t quite figure out how to do this with the
pagination_links helper, although I believe the API says you should be
able to:
pagination_links(paginator, options={}, html_options={})
options are:
:params: any additional routing parameters for page URLs
Has anyone tried this?
thanks,
jeff
--
2005 Mar 30
2
test65 killed by SIGSEV
Hi,
I had successfully set up dovecot-1.0-test62 + ldap pass/user db, but
now I'm encoutering a SIGSEV problem with a similar set up of a brand
new dovecot-1.0-test65 installation.
The auth process is killed by a SIGSEV as reported in the error log file :
dovecot: Mar 30 17:06:59 Error: child 28291 (auth) killed with signal 11
To be precise, the problem occurs in the
2006 Mar 05
7
whatever happend to unobtrusive javascript in Rails ?
Don''t get me wrong, JavaScript/Ajax helpers in Rails are a huge
timesaver and they have helped me to finally overcome my irrational
aversion to js libraries like prototype and such. However, all this
goodness seems to come at quiet a price. The resulting code is
littered with inline JS, including ubiquitous script tags and onload
attributes etc.. It seems that just when i found
2009 Apr 19
19
Controller spec: testing that scope is set
In a Rails controller I set the scope on a model class in an around
filter. I have defined expectations on the model classes, and ideally, I
would add a further expectation for the scope. Is this already possible
in some way? How would I go about adding support a scope expectation?
Michael
--
Michael Schuerig
mailto:michael at schuerig.de
http://www.schuerig.de/michael/
2005 Aug 22
8
Observing changes to a text field
I''ve noticed that using several TimedObservers (prototype.js) on a page
to watch for changes to text fields (haven''t tried forms) can have a
non-negligible effect on the CPU cycles used by the browser process.
Nothing dramatic, to be sure, but unnecessary.
Autocompleter.Base (controls.js) follows a smarter strategy to watch for
changes. Currently this functionality is tied
2005 Aug 13
4
Timing out ajax requests?
Has someone come up with a generic way to handle ajax requests that
exceed a certain time?
In my concrete case, I have several select boxes for drilling down a
hierarchy. When the user clicks an option, the next deeper level is
retrieved. To avoid multiple concurrent requests, I disable the select
box. As the request may take too long or cause an error, I set a
timeout that re-enables the
2006 Aug 08
7
Useful plugins for RadRails
Hi Friends,
Could anybody suggest me some nice and useful plugins for RadRails! It would
be very great if we make list of all such plugins!
1)________
2)________
3)________
4)________
5)________
6)________
7).....
Please fill above blanks and lets make a big list of it!
--
Don''t live to geek; geek to live.
http://anilw.info
-------------- next part --------------
An HTML attachment
2005 Sep 06
4
url_for: :overwrite_params went missing
Somewhere between 0.13.1 and the current SVN version
the :overwrite_params option to url_for (and related methods) went
missing. I can''t tell whether this was deliberate or by mistake, and I
have no idea how to get the same functionality in some other way
either.
Michael
--
Michael Schuerig Life is what happens
2005 Jun 29
2
Unit testing
Recently, I''ve started to write unit tests for some of my scripts. In
general,it''s no worse in JavaScript than in Ruby or Java. I didn''t have
the courage to try Selenium, but had a look at JsUnit. Unfortunately,
in Konqueror it produces unfathomable errors and in Firefox it is slow
beyond imagination.
Anyway, writing tests for functions that are computational or
2005 Sep 13
12
PDF views?
I know there''s wiki page on generating PDF[*], but that''s not really
what I want. I don''t need to create arbitrary PDF. What I''d like to do
is create PDF templates and fill in the blanks. Roughly, I''m looking
for functionality akin to the mail merge feature of word processors,
including conditional and repeated elements, say, table rows.
Michael
2006 Jul 28
4
Validation Reflection plugin
The validation reflection plugin adds three things
(1) Reflective access to validations
- ModelClass.reflect_on_all_validations
- ModelClass.reflect_on_validations_for(:property)
(2) It provides "declarative" methods for defining
validations based on database metadata
- validates_presence_of_mandatory_content_columns
- validates_lengths_of_string_attributes
-
2005 Aug 04
10
Rails Spin-offs WIKI.
http://rails-spinoffs.bombdiggity.net/index.php?title=Main_Page
guys here is the wiki. Once you register let me know and I''ll give you
full access to the site.
Jon
Jon Whitcraft
Online Services
(317) 492-8623
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2006 Jul 27
9
CalendarHelper
Has anyone had any luck using the CalendarHelper plugin at
http://wiki.rubyonrails.com/rails/pages/CalendarHelper recently?
I''m scratching my head over the following error when I look at any page
in my application:
NameError in CalendarController#index
undefined local variable or method `date_format'' for
#<CalendarController:0x24ccd4c>
RAILS_ROOT: