random Flashcards
Single responsibility principle
The single responsibility principle is a computer programming principle that states that every module or class should have responsibility over a single part of the functionality provided by the software, and that responsibility should be entirely encapsulated by the class
What is Rails?
Rails is a web application development framework written
Rails two major guiding principles:
Don’t Repeat Yourself:
Convention Over Configuration:
Installing Rails
1) $ ruby -v
2) $ sqlite3 –version
3) $ gem install rails
4) $ rails –version
Creating a Rails Application
$ rails new app_name
$ bundle install
$ cd app_name
What does the folder app/ contain?
Contains the controllers, models, views, helpers, mailers, channels, jobs and assets for your application.
What does the folder bin/ contain?
Contains the rails script that starts your app and can contain other scripts you use to setup, update, deploy or run your application.
What does the folder config/ contain?
Configure your application’s routes, database, and more. This is covered in more detail in Configuring Rails Applications.
whats in config.ru file?
Rack configuration for Rack based servers used to start the application.
What does the folder db/ contain?
Contains your current database schema, as well as the database migrations.
what’s in Gemfile and
Gemfile.lock file?
These files allow you to specify what gem dependencies are needed for your Rails application. These files are used by the Bundler gem. For more information about Bundler, see the Bundler website.
What does the folder lib/ contain?
Extended modules for your application.
What does the folder public/ contain?
The only folder seen by the world as-is. Contains static files and compiled assets.
what’s in Rakefile?
This file locates and loads tasks that can be run from the command line. The task definitions are defined throughout the components of Rails. Rather than changing Rakefile, you should add your own tasks by adding files to the lib/tasks directory of your application.
README.md
This is a brief instruction manual for your application. You should edit this file to tell others what your application does, how to set it up, and so on.