i was wondering how can i create my own custom validates_ function. e.g.
i am validating email adresses on a lot of places and would like to
achieve the following
class User
validates_email :email
end
does some has any hints?
with the same technique i would also like to do the following
class User
strip_attributes :firstname, :lastname
end
this would automatically ensure that the attributes firstname and
lastname are stored always without preceeding and trailing spaces.
thanks for your help…
On Nov 24, 9:12 am, Michal G. <rails-mailing-l…@andreas- s.net> wrote:
with the same technique i would also like to do the following
class User
strip_attributes :firstname, :lastname
end
this would automatically ensure that the attributes firstname and
lastname are stored always without preceeding and trailing spaces.
thanks for your help…
On Nov 24, 9:12 am, Michal G. <rails-mailing-l…@andreas- s.net> wrote:
with the same technique i would also like to do the following
class User
strip_attributes :firstname, :lastname
end
this would automatically ensure that the attributes firstname and
lastname are stored always without preceeding and trailing spaces.
thanks for your help…