Pregunta | Respuesta |
What does the command 'pwd' do when executed in an terminal? | This command display the current directory that a user is located in. |
What does the command 'ls' does when executed in an terminal? | This command list the files & folders that are located in the directory that the user is currently in. |
What does the command 'cd' does when executed in an terminal? | This command allows a user to move from one directory to another. |
What does the command 'cd ..' does when executed in an terminal? | This command allows a user to move back to the previous directory. |
What does the command 'mkdir' does when executed in an terminal? | This command is used to create a directory. |
What does the command 'rails -v' does when executed in an terminal? | This command displays the version of Rails installed. |
What does the command 'ruby-v' does when executed in an terminal? | This command displays the version of Ruby installed. |
What is the command that is used to create an application in Rails? | rails new name_of_application |
After creating an application in Rails what are the steps that are regarded for the application to work? | Go to the directory of the application and then run the 'bundle install' command. |
What command is used to install gems that are in the application Gemfile? | The 'bundle install' command. |
What is an gem? | A gem refers to a pre-packaged code that adds functionality to an application. |
What is the Gemfile? | The Gemfile consist of gems that are installed from a network server and used in an application. |
What is the command that is used to start an Rails server? | The command is 'rails server' |
How does one exit an rails server? | This done by pressing ctrl+c |
What is scaffolding? | This refers to creating the MVC files with the use of a single line command. |
What is the syntax of a rails scaffolding? | rails generate scaffold name_of_object |
Give an example of creating scaffold object name products that have an attribute name description and data type of text | rails generate scaffold Products description: text |
What is MVC? | MVC stands for Model, View & Controller |
Define each acronym of MVC | Model - is responsible for managing the application data. It takes request from the 'View" and instructions from the "Controller" about updating itself. It is located in the apps/model folder. View - is responsible for presenting the data in a particular format. It is triggered by the "Controller" decision to present data. It is located in the apps/views folder. Controller - is responsible for responding to a user inputs & performs interactions with data model objects. It is located in the apps/controller folder. |
Explain the following diagram | The diagram represents the process of MVC. The 'Controller' receives user inputs as a result the 'Controller' seeks data from the 'Model' which will be passed to the 'View' to present the data |
Ones scaffold is created there are four files that consist of placeholder codes. These files are placed views/name_of_object folder. What are these files and state there use. | Index - shows all data. Show - shows a single data. New - contain a blank form with fields that are used to data in a database. Edit - used to update details. |
What command is used to create a database that stores data? | The command is 'rake db:migrate' |
How does one change the homepage of a rails server? | This is done by placing " root 'name_of_object#index' " under "resources :name_of_object" in the config/routes.rb file. |
¿Quieres crear tus propias Fichas gratiscon GoConqr? Más información.