English 中文(简体)
我应如何安排我的铁路3号,在Heroku进行海滩测试?
原标题:How should I structure my Rails 3 app for beta testing on Heroku?

I m diving into Duncan on Railways and I mtries tobuilding a basic web app from scratch to Learning the table and associated technology. 迄今为止,我只靠当地机器运行,但我愿意将其部署到一个自由的Heroku账户,以开始熟悉部署情况,并在一个活服务器上测试仪器。 显然,我不想让任何人公开,因为它远未完成,根本不准备公开使用。 我对我所试图做的事情的看法与封闭的贝塔测试相似,但鉴于这是我第一次走过来,我没有任何想法指导我实现这一目标。

我有用户账户和认证。 我可以做的一件事是安装一个静态的着陆页,显示该站点正在施工之中,而且由于我有志于URL,我只能增加<代码>,以免出现过滤器<<<>>。 给我的各位控制人员,以便只有我能够登录和进入该网站,但是,这感觉到黑客般的 and,使我能够适当测试应该公开的网页(因为这些网页是私人的)。 我至少在这里有正确的想法吗? 还是我的策略偏离了吗?

Heroku是否建造了任何设施,支持将网站保留到公众准备就绪为止?

任何方向都会有所帮助。

问题回答

首先,如果你再次使用其oku产生的子主(如“前flow-99.heroku.com”),那么任何人都不会 st。 或者,你可以说明一个非常模糊的领域/主要决定因素。

之后,最容易做的事情可能是在申请控制人面前添加基本认证,并排在前。 与此类似:

class ApplicationController < ActionController::Base
before_filter :beta_login_required

protected

    def beta_login_required
      authenticate_or_request_with_http_basic do |username, password|
        username == "foo" && password == "bar"
      end
    end

这将给你一个以旧学校浏览器为基础的用户名和密码方言。 如果你想跳出任何地点,那么,就在控制器的过滤之前,就跑了一个天空。

如果在某个时候,你想要允许多个用户在不必执行http:// basic auth的情况下接受ta测试,那么你就可以在用户模式上设定一个地位归属。 这样,你就能够有人签字,然后通过Heroku console或你自己的行政页批准。

The new Rails Enums feature makes it really easy.

移徙:

rails g migration AddStatusToUsers users:integer

包括 en和先采取行动:

class User
  enum status: [:pending, :live]
end

class ApplicationController
  before_action :must_be_approved_beta_user

  def must_be_approved_beta_user
    redirect_to home_path unless current_user.live?
  end
end

The #live? method is given to you free with Enums. http://edgeapi.rubyonrails.org/classes/ActiveRecord/Enum.html





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签