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

  • Home
  • SEARCH
  • 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 8691435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:07:18+00:00 2026-06-13T00:07:18+00:00

I am trying to use a controller and action to do a simple check

  • 0

I am trying to use a controller and action to do a simple check to see if a user account with that email address exists or not.

The controller’s action looks like this:

def checkEmail
    email = params["email"]
    if Account.find_by_email(email).blank?
      render :inline=>"true"
    else
      render :inline=>"false"
    end
  end

And to test this action, I can go to:

http://localhost:3000/home/checkEmail/email@website.com

When I do so, I can see in the Ruby console the following being queried:

Parameters: {"email"=>"email@website"}
  Account Load (0.0ms)  SELECT `accounts`.* FROM `accounts` WHERE `accounts`.`email` = 'email@website' LIMIT 1

You can see that the TLD of the email address has been cropped off.

However, when I go to:

http://localhost:3000/home/checkEmail/email@website.co.uk

I get a routing error:

No route matches [GET] "/home/checkEmail/email@website.co.uk"

My routes.rb file looks like this:

Gallery::Application.routes.draw do

  #Match home URL
  match 'home(/:file)' => "home#index"
  match 'home/checkUser/:username' => "home#checkUser"
  match 'home/checkEmail/:email' => "home#checkEmail"

  root :to=> "home#index"
end
  • 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-06-13T00:07:19+00:00Added an answer on June 13, 2026 at 12:07 am

    Yeah, the default behavior in Rails is to treat a dot (.) in a route as a format specifier, instead of part of the parameter.
    In order to match the dot as part of the parameter, specify the route like this:

    match "/home/checkEmail/:email" => "home#checkEmail", :constraints => { :email=> /[^\/]*/ }
    

    Here’s a post that describes the problem and the fix:
    http://coding-journal.com/rails-3-routing-parameters-with-dots/

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

Sidebar

Related Questions

I'm trying to use action mailer to send a simple email to a user
I am trying to use some action when I click button in navigation controller.
I'm trying to create a very simple email signup form, where the user can
I am trying to use a very simple resource route for my Buildings Controller.
I am trying to test an action on a controller. It's a rather simple
I am trying to use a layout for each actions in a controller. For
I have an extremely simple example trying to use Data Annotations with unobtrusive javascript
I'm trying to add a custom action to a core controller by extending it
I'm trying to make a simple link that will toggle my status attribute in
I'm trying to use a UITextField as an output for a simple encryption. The

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.