English 中文(简体)
你如何直观地区别你们 用于轮胎/试验/生产模式的铁路?
原标题:How do you visually distinct your Rails app for dev/test/production modes?

令人奇怪的是,你如何把不同铁路模式的发展/试验和生产区分开来?

Im afraid that since visually the apps look the same in each mode, my customer can use the wrong environment and enter production data in a test environment.

我现在要改变我的申请中的背景,以确保有不同之处。 BUt i将拥有一些根据运行的环境自动发挥作用的智能。 也许有BIG水分。

Any best practices here?

根据Artimuz的答复,我做了以下工作:

添加到 申请_helper.rb

  def development?
    @is_development ||= (ENV[ RAILS_ENV ] !=  production )
  end

then in application.html.erb i added:

 <head>
 <% if development? %>
    <style type="text/css">
        html {              
         background-image: url(/assets/test.png);
         background-color: silver;
        }
    </style>>   
  <% end %>
 </head>

测试。 png只是一个具有透明度的板块,其字体是内部和分界线。 象一个药店一样,确保你能够在发展/试验环境中 mis误你。

最佳回答
问题回答

暂无回答




相关问题
Remove ActiveRecord in Rails 3

Now that Rails 3 beta is out, I thought I d have a look at rewriting an app I have just started work on in Rails 3 beta, both to get a feel for it and get a bit of a head-start. The app uses MongoDB ...

When will you upgrade your app to Rails 3? [closed]

Now that the Rails 3 beta is here, let s take a little straw poll. Please tell us briefly what your application does and when you will upgrade it to Rails 3. Or, if you re not planning on upgrading ...

Bundler isn t loading gems

I have been having a problem with using Bundler and being able to access my gems without having to require them somewhere, as config.gem used to do that for me (as far as I know). In my Rails 3 app, I ...

bypass attr_accessible/protected in rails

I have a model that, when it instantiates an object, also creates another object with the same user id. class Foo > ActiveRecord::Base after_create: create_bar private def create_bar Bar....

concat two fields activerecord

I m so used to oracle where you can simply concat(field1, , field2) but if I m using activerecord to find the field1 and field2, and I need a space in between, how do I accomplish this? Cheers ...

热门标签