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 9141959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:42:52+00:00 2026-06-17T09:42:52+00:00

I have following route: GET /confirm/:token(.:format) Confirmations#confirm Controller: class ConfirmationsController < ApplicationController # GET

  • 0

I have following route:

GET    /confirm/:token(.:format)  Confirmations#confirm

Controller:

class ConfirmationsController < ApplicationController
  # GET /confirm/<token>
  def confirm
    @user = User.find_by_email_token(params[:token])
    if @user
      @user.confirmed = true
      @user.email_token = nil
      @user.save!
      sign_in @user
      redirect_to root_url, flash: { success: "Welcome <#{@user.email}>, your address has been verified." }
    elsif
      redirect_to root_url, flash: { error: "Error: could not find matching user record." }
    end
  end
end

And this simple confirmations_controller_spec.rb:

require 'spec_helper'

describe ConfirmationsController do

  let(:user) { FactoryGirl.create(:user, email_token: "some_token") }

  describe "Get confirm" do
    it "confirms user with valid email_token" do
      get :confirm, token: "some_token"
      assigns(:user).should eq(user)
      user.reload.email_token.should be_nil
    end

    it "does not confirm user with invalid email_token"
  end
end

but it fails:

  1) ConfirmationsController Get confirm confirms user with valid email_token
     Failure/Error: get :confirm, token: "some_token"
     ActionController::RoutingError:
       No route matches {:token=>"some_token", :controller=>"confirmations", :action=>"confirm"}
     # ./spec/controllers/confirmations_controller_spec.rb:9:in `block (3 levels) in <top (required)>'

Anyone see what (could be multiple things) I screwed up?

BTW- I’m using a get request here (as opposed to put) because it’s being initiated from a text based email so we can’t, to my understanding, use a put request…

  • 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-17T09:42:52+00:00Added an answer on June 17, 2026 at 9:42 am

    In your rake routes, Confirmations should not have a capital letter.

    Can you define the route like so in config/routes.rb:

    match '/confirm/:token' => 'confirmations#confirm'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following route: {language}/{controller}.mvc/{action}/{id} Once a user has choosen the language it
I have the following routes in my app: GET /admin/comments(.:format) {:controller=>admin/comments, :action=>index} admin_comments POST
Using Rails 3.0.3. I have the following route in routes.rb: match user/create_new_password/:reset_password_key =>users#create_new_password, :via=>[:get,
Given the uri... http://localhost:5613/api/user/1/HasCompletedInitialScreen I have the following route configured... public static class WebApiConfig
I have the following route: routes.MapRoute( Default, // Route name {controller}/{action}/{id}, // URL with
I have the following markup: <div id=routes> <ul id=routesList> <li class=routes>Route 1</li> <li class=routes>Route
Let's say I have the following rule routes.MapRoute( Default, // Route name {controller}/{action}/{id}, //
I have the following when I do rake routes next_post /users/next_post/:index(.:format) {:controller=>users, :action=>next_post} then,
I have following @Route annottations for my Controller's method: /** * @Route(/{id}/edit, name=section_edit) *
I have the following route map.resource :account, :controller => users map.resources :users and /account/new

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.