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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:03:35+00:00 2026-05-31T11:03:35+00:00

I use require_admin! frequently in my controllers. It works great. Now, I want to

  • 0

I use require_admin! frequently in my controllers. It works great.

Now, I want to add named route like so:

# config/routes.rb
match "poniesandrainbows" => redirect("https://poniesandrainbows.com")
# ^sadly, not really a website, btw.^

How do I restrict access to that route? Is this possible? Obviously it redirects to a public URL, but I still want to keep the route private.

  • 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-31T11:03:37+00:00Added an answer on May 31, 2026 at 11:03 am

    You cannot restrict access from routes.

    The safest way to match “poniesandrainbows” with a controller where you can use require_admin! and then redirect them to the public url.

    You can try to solve the problem on the front end. Maybe only show the link to admin users.
    It won’t stop other users to paste the link directly to their browser url though

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

Sidebar

Related Questions

Now facebook require to have these options when you want to use bulit-in actions
I want to use rb_require with rb_protect, as in the following example: int error;
I want to use 2 layouts for main page and admin page What should
I use this gem https://github.com/rweng/jquery-datatables-rails to add datatables to my rails app project. I
Building an MVC3 application, and TPTB want us to use their custom authorization provider.
I'm working with Jade and Express and I would like to use a variable
my problem is that when I use mysql in global scope it works, but
I have the following problem trying to use a custom config section in my
I want to use Daemons gem with my Rails project so I can easily
I want to be able to use methods that I haven't required() at 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.