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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:49:41+00:00 2026-05-25T15:49:41+00:00

So I am using the Vanity gem that handles all params[:vname] in my URLs

  • 0

So I am using the Vanity gem that handles all params[:vname] in my URLs and redirects to the right place for most vnames.

But I just added authentication via Omnipopulus – https://github.com/icelab/omnipopulus – and it requires me to go to `mydomain.com/login’.

But when I do that it sends it to my Vanities controller. Here is the log of that request:

Started GET "/login" for 127.0.0.1 at 2011-09-18 16:39:15 -0500
  Processing by VanitiesController#show as HTML
  Parameters: {"vname"=>"login"}
  Vanity Load (0.1ms)  SELECT "vanities".* FROM "vanities" WHERE "vanities"."name" = 'login' LIMIT 1
Rendered public/404.html within layouts/application (0.0ms)
Completed 404 Not Found in 13ms (Views: 11.5ms | ActiveRecord: 0.3ms)

What the Vanities controller does, is when it gets a URL as mydomain.com/vname it checks to see if a vname record exists for the value in the params (which is typically a username). If it finds one, it redirects to the show action of that user. But given that login is not a user nor username, it shouldn’t be handling the routing for that keyword.

How do I add an exception?

This is the route for the Vanities controller:

 controller :vanities do 
    match ':vname' => :show, :via => :get, :constraints => {:vname => /@?[A-Za-z0-9\-\+]+/}, :as => :vanity
  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-05-25T15:49:42+00:00Added an answer on May 25, 2026 at 3:49 pm

    I’ve never used (or even heard of) this gem before, but looking at its source code, see:
    https://github.com/icelab/omnipopulus/blob/master/config/routes.rb

    This appears to install itself as a Rails engine, and therefore isn’t really in your routes.rb file. I’m thinking there may be a few things to test here.

    First of all, realize that vanities’ routes MUST be the ABSOLUTE DEAD LAST in your routes file. What’s happening here is that when you call /login, the vanities routing is happening before your authentication gem’s routing is being called. Normally I’d just say, “move the vanities routes to the last in routes.rb”, but given that omnipopulous injects its routes based on its engine, that may not be enough.

    I see two possible ways of solving this:

    1. Check out Gemfile and make sure that Vanities is loaded AFTER omnipopulous.
    2. If that fails, copy the routes in the link I posted above into routes.rb BEFORE the vanities routes.

    I see #2 as an ugly hack, so I really hope #1 works first (depends on load order for gems with bundler, which I think will go top-down, but I don’t have any proof of that so far).

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

Sidebar

Related Questions

I understand that there may be other questions regarding vanity urls but everyone i
Can someone please walk me through the workflow required to support vanity URLs using
I am using Vista, but most of the other developers working on the same
Using linq, How can I sort an array and after that return all numbers
Using the Redis info command, I am able to get all the stats of
Using Trigger.io's barcode api in an application that only contains boilerplate HTML and the
I've recently deployed some A/B testing experiments using vanity to my heroku instance. However,
using phpPgAdmin, I've tried to create a table in my database. But am getting
Using this as an example, how could I scale the graphic such that it's
Using ember 1.0.0-pre3 I have a little app that has this code: window.App =

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.