random Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

Single responsibility principle

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Rails?

A

Rails is a web application development framework written

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Rails two major guiding principles:

A

Don’t Repeat Yourself:

Convention Over Configuration:

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Installing Rails

A

1) $ ruby -v
2) $ sqlite3 –version
3) $ gem install rails
4) $ rails –version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Creating a Rails Application

A

$ rails new app_name
$ bundle install
$ cd app_name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does the folder app/ contain?

A

Contains the controllers, models, views, helpers, mailers, channels, jobs and assets for your application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does the folder bin/ contain?

A

Contains the rails script that starts your app and can contain other scripts you use to setup, update, deploy or run your application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the folder config/ contain?

A

Configure your application’s routes, database, and more. This is covered in more detail in Configuring Rails Applications.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

whats in config.ru file?

A

Rack configuration for Rack based servers used to start the application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the folder db/ contain?

A

Contains your current database schema, as well as the database migrations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what’s in Gemfile and

Gemfile.lock file?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What does the folder lib/ contain?

A

Extended modules for your application.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does the folder public/ contain?

A

The only folder seen by the world as-is. Contains static files and compiled assets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what’s in Rakefile?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

README.md

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What does the folder test/ contain?

A

Unit tests, fixtures, and other test apparatus. These are covered in Testing Rails Applications.

17
Q

What does the folder tmp/ contain?

A

Temporary files (like cache and pid files).

18
Q

What does the folder vendor/ contain?

A

A place for all third-party code. In a typical Rails application this includes vendored gems.

19
Q

gitignore

A

This file tells git which files (or patterns) it should ignore. See Github - Ignoring files for more info about ignoring files.

20
Q

Starting up the Web Server

A

$ rails server

21
Q

What is a controller

A

A controller’s purpose is to receive specific requests for the application.

22
Q

What is routing

A

Routing decides which controller receives which requests.

23
Q

What is an action

A

Each action’s purpose is to collect information to provide it to a view.

24
Q

What is a view?

A

A view’s purpose is to display this information in a human readable format.

25
Q

create a new controller

A

$ rails generate controller Welcome index

tell it you want a controller called “Welcome” with an action called “index”

26
Q

Setting the Application Home Page

A

Open the file config/routes.rb in your editor.

add root ‘welcome#index’

27
Q

Whats a resource?

A

A resource is the term used for a collection of similar objects, such as articles, people or animals

28
Q

What can you do with a resource?

A

You can create, read, update and destroy items for a resource and these operations are referred to as CRUD operations.

29
Q

where do i add a resource?

A

resources :articles in config/routes.rb

30
Q

How to see routes?

A

$ rails routes

31
Q

What environments do rails have?

A

test, production, and development

32
Q

How do you see the current environment?

A

in folder config/environment and RAILS_ENV,