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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:55:50+00:00 2026-05-19T13:55:50+00:00

Is there a way to upload an app, but only have it accessible by

  • 0

Is there a way to upload an app, but only have it accessible by me? Or perhaps by a specific set of IP’s?

Reason being, we want to run a few private online tests before opening the app up to the general public. So far I have come up with the following code:

class ApplicationController < ActionController::Base
  before_filter :restrict_access

  def restrict_access
    whitelist = ['127.0.0.123', '10.0.1.7', '10.0.1.8'].freeze

    unless( whitelist.include? request.env['REMOTE_ADDR'] )
      render :file => "#{Rails.public_path}/500.html", :status => :unauthorized
      return
    end
  end
end

However, the above code still renders the main layout file (app/views/layouts/application.html.erb) which exposes the logo and footer. For un-authorised access we want to display a page that says something like “Ooops, we are still doing a few tests and will be public soon!”. No logo of the site, no nothing. Just a simple message.

We are using devise as our authentication gem. We don’t want to add authentication functionality just to restrict access for private beta testing. We want to do it by IP instead.

Is such a thing possible? Perhaps the code above just needs working on? Or is there a gem that we can use solely for this requirement?

  • 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-19T13:55:51+00:00Added an answer on May 19, 2026 at 1:55 pm

    If you’re deploying on Apache or Nginx, this should be easy enough to configure in the relevant site config files. Doesn’t need to be in the app itself, in that case.

    I’m not totally sure what the issue is with your existing code. Are you saying that the filter seems to be ignored, or that the file renders within the layout? If it’s the latter, specifying :layout => false as a render option should take care of that.

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

Sidebar

Related Questions

I want to upload my Update to the iTunes Store (Universal App) but it
Is there any way to upload an entire folder using PHP?
Is there a way to upload a file, save it to a Stream, this
Is there a simple way to upload a single file through HTML input type
If there is a way to Upload file using rest via stream would there
I wanted to knw if there is way we can upload /download a blob;
Is there some way to validate the image size (height and width) before upload
I'm trying to automate the upload of a google app engine (java) project, there's
I have an app that lets users upload documents. The app saves the documents
I have a rails app where users share specific kinds of photos. Currently 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.