<html> <body> <div class="container"> <%= render 'layouts/footer'%> <%= debug(params) if Rails.env.development? %> </div> </body> </html>
since we don't want to display the debug info to a deployed application, we use
if Rails.env.development?
to restrict the debug info to dev environment.
(rails console ---------------> this will start as dev environment)
(rails console test ---------------> this will start as test environment)
(rails console production ---------------> this will start as production environment)
(rails server )
(rails server --environment product )
(rails server --environment test )
(rake db:migrate RAILS_ENV=production )
(rake db:migrate RAILS_ENV=test)
(it is confusing that the three command are using diff format to specify env, worth to remember it.)
also, if you are using heroku, you can also start heroku console:
heroku console
Rails.env
====> "production"
Rails.env.production?
====> true
发表评论
-
12.3.3 scaling issue of the status feed
2011-10-30 17:54 816the problem of the implementati ... -
12.3 the status feed
2011-10-30 15:34 8531. we need to get all the micro ... -
12.2 a working follow button with Ajax
2011-10-29 18:10 9101. in the last chapter, in the ... -
12.2 a web interface for following and followers.
2011-10-28 22:14 8761.before we do the UI, we need ... -
12. following user, 12.1 relationship model
2011-10-18 14:29 7471. we need to use a relationshi ... -
11.3 manipulating microposts.
2011-10-17 15:31 8931. since all micropost actions ... -
11.2 show microposts.
2011-10-17 12:01 6981. add test to test the new use ... -
11.1 user micropost -- a micropost model.
2011-10-17 10:43 11031. we will first generate a mic ... -
10.4 destroying users.
2011-10-16 15:47 735in this chapter, we will add de ... -
10.3 showing users list
2011-10-15 20:41 768in this chapter, we will do use ... -
10.2 protect pages.
2011-10-15 15:11 657again, we will start from TD ... -
10.1 updating users.
2011-10-14 18:30 7051. git checkout -b updating-use ... -
9.4 sign out
2011-10-13 15:21 732whew!!!, last chapter is a long ... -
9.3 sign in success.
2011-10-12 15:39 7411. we will first finish the cre ... -
9.1 about flash.now[:error] vs flash[:error]
2011-10-12 15:37 722There’s a subtle difference ... -
9.2 sign in failure
2011-10-12 12:19 655start from TDD!!! 1. requir ... -
9.1 sessions
2011-10-12 10:00 643a session is a semi-permanent c ... -
what test framework should you use?
2011-10-11 16:56 0for integration test, i have no ... -
what test framework should you use?
2011-10-11 16:56 0<p>for integration test, ... -
8.4 rspec integration tests
2011-10-11 16:53 714in integration test, you can te ...
相关推荐
除此之外,Rails还引入了一些设计模式,如资源路由(Resourceful Routing)、部分视图(Partials)和布局(Layouts)。资源路由使你可以用简洁的语法定义CRUD操作,部分视图用于代码重用,布局则可以创建页面的通用...
Stepping to the next line in the source program . . . . . . . . . . . . Stepping into a subroutine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Examining the Stack . . . . . . . . . ....
Flexalon Pro 3D UI Layouts v4.0.0
1.12 The Future................................................................................................ 52 1.12.1 Optical Communications Telescope Facility (OCTL) ............... 52 1.12.2 ...
Changes to the Handling of Deprecation Warnings Python 3.1 Features PEP 372: Adding an Ordered Dictionary to collections PEP 378: Format Specifier for Thousands Separator PEP 389: The argparse ...
Table of Contents Preface, Notes, Licenses . . . . . . . . ....1. Licenses for Third-Party Components ....1.1. FindGTest.cmake License ....1.2. LPeg Library License ....1.3. LuaFileSystem Library License ....
It supports a variety of tags and expressions that make it easy to manipulate data and generate complex layouts. 4. **Menus and Views**: These components define the navigation structure and the ...
must configure the Python interpreter and the Debug Client to be used in the Preferences dialog. eric5 includes two different versions of the debug client. DebugClient.py is the traditional ...
Each chapter and app has been designed and tested to provide the knowledge and experience you need to get started in Android development. Big Nerd Ranch specializes in developing and designing ...
How to add identifiers to views and constraints Ambiguous layouts - tell me more! Using the view debugger Private debug methods - keep them to yourself. Layout loops...layout loops...layout loops
在结合Rails 4.x这样的Ruby on Rails框架时,Bootstrap能够极大地提升Web应用的用户体验和视觉吸引力。 本示例"bootstrap_example"旨在展示如何在Rails 4.x应用程序中有效地整合Bootstrap。Rails 4.x是Ruby on ...
This tutorial will teach you basic Android programming and will also take you through some advance concepts related to Android application development. This book will help you Table of Contents ...
From organizing your code in a logical and physical way, you will go on to delimit view responsibilities and work with complex layouts. Synchronizing models in a two-way binding can be difficult and...
Thymeleaf Examples: Layouts ...This is an example project containing code used in the "Thymeleaf Layouts" tutorial. The project was created using Spring MVC 4 Quickstart Maven archetype: ...