concept default in category ruby

appears as: default, default, defaults, The default
Rails 4 in Action: Revised Edition of Rails 3 in Action

This is an excerpt from Manning's book Rails 4 in Action: Revised Edition of Rails 3 in Action.

  • Views display the information gathered by the controller, by referencing the instance variables set there, in a developer-friendly manner. In Ruby on Rails, this display is done by default with a templating language known as Embedded Ruby (ERB). ERB allows you to embed Ruby into any kind of file you wish. This template is then preprocessed on the server side into the output that’s shown to the user.
  • A handler is a preprocessor for the template, or a templating language. There are a number of handlers built in (as the error output lists), and many more can be added by using extra gems, but the default for Rails views is :erb. Putting it all together, the view that your index action will render belongs in app/views/projects/index.html.erb.

    This file also requires the sqlite3 gem, which is used for interacting with SQLite3 databases, the default when working with Rails. If you were to use another database system, you’d need to take out this line and replace it with the relevant gem, such as mysql2 for MySQL or pg for PostgreSQL.

    Listing 4.40. The important parts of the default application.js file
    //= require jquery //= require jquery_ujs //= require turbolinks //= require_tree .
    Figure 13.1. The default generated Heroku app
    Rails 3 in Action

    This is an excerpt from Manning's book Rails 3 in Action.

    Views display the information gathered by the controller, by referencing the instance variables set there, in a user-friendly manner. In Ruby on Rails, this display is done by default with a templating language known as Embedded Ruby (ERB). ERB allows you to embed Ruby (hence the name) into any kind of file you wish. This template is then preprocessed on the server side into the output that’s shown to the user.

    The first part, index, is the name of the action; that’s the easy part. The second part, html, indicates the format of this template. Actions in Rails can respond to different formats (using respond_to, which you saw in chapter 1); the default format is html. The third part, erb, indicates the templating language you’re using, or the handler for this specific template. Templates in Rails can use different templating languages/handlers, but the default in Rails is ERB, hence the erb extension.

    This file also requires the sqlite3 gem, which is used for interacting with SQLite3 databases, the default when working with Rails. If you were to use another database system, you would need to take out this line and replace it with the relevant gem, such as mysql2 for MySQL or pg for PostgreSQL.

    And I follow "Make default" for the "New" state