Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7027091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:12:08+00:00 2026-05-28T00:12:08+00:00

The domain name is static so it will always be the same. Its not

  • 0

The domain name is static so it will always be the same. Its not like a magic number that could so I need to right a regex or use something in rails that can validate that domain = “domain.com” or whatever I put there…

I have been playing with:

 validates_each :email |record, attr, value|
      record.errors.add attr 'bad domain' unless /ravennainteractive.com$/ =~ value
  end

that doesn’t work…

thanks so much for your help.

Edit 1/9/12

So after looking closer at the rails guides, I modified what I had with what Vivek said and here is what I am using:

validates_each :email do |record, attr, value|
       record.errors.add(attr, 'You must use an ravennainteractive.com email address') unless value =~ /ravennainteractive.com$/
   end

this is accepting invalid values: (from the log) “approvals_attributes”=>{“0″=>{“email”=>”tj@4thavenuemedia.com”}}}, “commit”=>”Save”}

I should also note that this is validating on a nested form. This is a Recommendation#new form with a fields_for…

any other ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T00:12:09+00:00Added an answer on May 28, 2026 at 12:12 am

    I am not sure it this helps, but shouldn’t the value match the expression?

    Shouldn’t it be unless value =~ /ravennainteractive.com$/ ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Need to replace a domain name on all the links on the page that
Why do we use reverse domain name like com.something. or org.something. structure for java
I have a php server that is running my domain name. For testing purposes
I'm building a public website which has its own domain name with pop/smtp mail
I am trying to write a java program that will automatically download and name
I have some code that looks like the following. First I have some domain
My Grails app has the following domain objects class ProductType { String name static
What is the benefits of seperating css,js and media folders under subdomains like css.domain-name.com
I have two domain models: class Resource{ String name static mapping = { sort
I have a separate domain name for static content such as images, js files,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.