#107 ✓resolved
pulkit pancholi

Custom Validation

Reported by pulkit pancholi | May 16th, 2009 @ 02:06 AM

I read config.rb file in authlogic plugin.

In that you told that to do custom validation use below code:

class User < ActiveRecord::Base
acts_as_authentic :my_option => "my value" end

I want custom validation message for password confirmation.

For that I wrote below code:

acts_as_authentic :password_confirmation_field_validates_presence_of_options => {:message => "Password doesn't match"}

I didn't get any error but it's not working.

Can you tell me where I am wrong?

Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson May 16th, 2009 @ 02:09 AM

    • State changed from “new” to “resolved”

    Use:

    acts_as_authentic do |c|
    c.config = value
    end
    

    You are using the old configuration syntax.

  • pulkit pancholi

    pulkit pancholi May 16th, 2009 @ 02:18 AM

    I tried below code:

    acts_as_authentic do |c|

    c.password_confirmation_field_validates_presence_of_options = {:message => "Password doesn't match"}
    

    end

    Though I am getting default validation messgae "doesn't match confirmation"

  • Ben Johnson

    Ben Johnson May 16th, 2009 @ 02:22 AM

    Checkout Authlogic::ActsAsAuthentic::Password in the docs: http://authlogic.rubyforge.org

  • sdasfdf

    sdasfdf July 10th, 2018 @ 12:34 PM

    Thanks for sharing.I found a lot of interesting information here. A really good post, very thankful and hopeful that you will write many more posts like this one.

    Gmail Login
    AnyDesk
    Lucky Patcher

  • denis_richard

    denis_richard March 29th, 2019 @ 08:21 AM

    Earlier in 1849, the time when West was Wild and gunslingers encountered on the street, gold was exposed in the sleepy town of Sunset Bluff. Just like a coyote attracted to the smell of blood, the Quicksilver Bandits rode into town to snatch the mines and start the law of the gun. Do they grant essay service? The deserted people have agonized, and now they're seeing you, their rescuer.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.

People watching this ticket

Pages