SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
|
Email
Search
Test your basic knowledge |
Ruby On Rails Basics
Start Test
Study First
Subject
:
it-skills
Instructions:
Answer 50 questions in 15 minutes.
If you are not ready to take this test, you can
study here
.
Match each statement with the correct term.
Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.
This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. A script that alters the structure of the underlying database
migration
underscores
the page template
put a $ sign in front. For example $x
2. to create a migration that adds a "phone" field to the "tickets" table
config/routes.rb
include modulename
rails generate migration AddPhoneToTickets phone:string
rake db:migrate
3. edit routes
RAILS_ENV (RAILS_ENV=production)
config/routes.rb
#{1+1}
rails generate migration AddPhoneToTickets phone:string
4. the model-generator command create the model class (app/models/something.rb) and the ____________
nested classes
data migration (db/migrate/..._create_something.rb)
integration
CamelCase
5. A search form is not associated with a ______
model
rails generate migration AddPhoneToTickets phone:string
#{1+1}
production
6. Allows instance variables to be accessible outside the class by defining = operators for variables
attr_accessor
f.error_messages
underscore
errors.add_to_base("there was an error")
7. This is a comparison operator
RAILS_ENV (RAILS_ENV=production)
runs its validators
rails generate migration AddPhoneToTickets phone:string
<=> operator
8. Converts database records to objects
always public
runs its validators
replace the word "scaffold" with the word "model"
an object-relational mapping library
9. to create a migration that adds a "phone" field to the "tickets" table
CamelCase
ActiveRecord
plural
rails generate migration AddPhoneToTickets phone:string
10. Naming convention for classes
<=> operator
CamelCase
polymorphism
config/routes.rb
11. controller (and table) names are _______
runs its validators
<% form_for() %>
<=> operator
plural
12. You add the filter code right after the line introducing __________ in the controller
attr_accessor
<% form_for() %>
rails generate migration AddPhoneToTickets phone:string
the class
13. to include a module inside another class/file
include modulename
a responder object
singular
public
14. This precedes the "check_logged_in" method in a class
a responder object
the word "private"
<=> operator
Embedded Ruby (ERb)
15. to destroy a row with id of 2 using only one line...
Tweet.find(2).destroy
rake db:migrate
:controller
<% form_for() %>
16. models have only ______names
RAILS_ENV (RAILS_ENV=production)
validate
f.error_messages
singular
17. The "format" in "repond_to do |format|"? is a ______
puts 12.chr
singular
config/routes.rb
a responder object
18. A search form is not associated with a ______
model
ruby make
production
attr_accessor
19. to insert "1 + 1" into a string
underscores
integration test
include modulename
#{1+1}
20. This variable changes the environment
Modules
RAILS_ENV (RAILS_ENV=production)
render :partial
Embedded Ruby (ERb)
21. Rails' object-relational mapping library
ActiveRecord
Embedded Ruby (ERb)
ruby make
RAILS_ENV (RAILS_ENV=production)
22. Long form of "rake" which can do more complex things like modifying the database structure and running testsis
ruby make
the page template
ActionPack
nested classes
23. Before it saves or updates data a model object _______
runs its validators
#{1+1}
nested classes
helper method
24. Default Rails environments: development - test - ________
production
ActiveRecord
underscores
a responder object
25. This variable changes the environment
attr_accessor
<%= yield %>
RAILS_ENV (RAILS_ENV=production)
created_at
26. to generate regular model code (not scaffolding)
replace the word "scaffold" with the word "model"
Modules
helper method
the page template
27. These create namespaces
Structs
ruby make
RAILS_ENV (RAILS_ENV=production)
Modules
28. to declare global variables
put a $ sign in front. For example $x
production
an object-relational mapping library
puts 12.chr
29. to add an error (called "there was an error") in the validate method
puts ?x where x is the character (not variable)
the word "private"
replace the word "scaffold" with the word "model"
errors.add_to_base("there was an error")
30. to specify a format like html or xml in routes.rb
Modules
helper method
created_at
.:format
31. h in in <%=h ... %> is a ______ that escapes special characters to sanitize malicious input
helper method
Embedded Ruby (ERb)
a responder object
Structs
32. You add the filter code right after the line introducing __________ in the controller
the class
replace the word "scaffold" with the word "model"
RAILS_ENV (RAILS_ENV=production)
include modulename
33. Long form of "rake" which can do more complex things like modifying the database structure and running testsis
created_at
integration test
<%= yield %>
ruby make
34. the second uri indicate
RAILS_ENV (RAILS_ENV=production)
config/routes.rb
:controller
the class
35. edit routes
singular
integration test
config/routes.rb
validates_numericality_of
36. models have only ______names
.:format
singular
runs its validators
put a $ sign in front. For example $x
37. The three kinds of tests are: unit and functional and _________ tests
<% form_for() %>
integration
errors.add_to_base("there was an error")
puts 12.chr
38. the second uri indicate
model
:controller
HTTP methods (post - get - put - delete)
public
39. Default Rails environments: development - test - ________
:controller
helper method
the class
production
40. This method name indicates to rails that it should validate before saving/updating
model
Structs
validate
underscores
41. Embedded Ruby (ERb) processes data from model objects AND _______ as inputs
#{1+1}
<=> operator
ActionPack
the page template
42. Command to run a migration
replace the word "scaffold" with the word "model"
runs its validators
underscores
rake db:migrate
43. This method name indicates to rails that it should validate before saving/updating
the word "private"
validate
helper method
<% form_for() %>
44. These create namespaces
Structs
Modules
singular
public
45. Rails' application framework
migration
puts ?x where x is the character (not variable)
an object-relational mapping library
ActionPack
46. A special class whose only job is to have attributes and to hold data
Structs
ruby make
<=> operator
<%= yield %>
47. Naming convention for file names
rails generate migration AddPhoneToTickets phone:string
rake db:migrate
underscores
migration
48. to get ascii value of a character
puts ?x where x is the character (not variable)
data migration (db/migrate/..._create_something.rb)
f.error_messages
the word "private"
49. This precedes the "check_logged_in" method in a class
rake db:migrate
model
the word "private"
ActionPack
50. Methods by default are ________
rake db:migrate
the class
public
ActionPack