SUBJECTS
|
BROWSE
|
CAREER CENTER
|
POPULAR
|
JOIN
|
LOGIN
Business Skills
|
Soft Skills
|
Basic Literacy
|
Certifications
About
|
Help
|
Privacy
|
Terms
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. Command to run a migration
config/routes.rb
rake db:migrate
singular
polymorphism
2. A search form is not associated with a ______
puts 12.chr
Embedded Ruby (ERb)
an object-relational mapping library
model
3. h in in <%=h ... %> is a ______ that escapes special characters to sanitize malicious input
:controller
runs its validators
model
helper method
4. declaring classes inside another class
the word "private"
nested classes
puts ?x where x is the character (not variable)
integration
5. Long form of "rake" which can do more complex things like modifying the database structure and running testsis
ruby make
.:format
f.error_messages
model
6. to include a module inside another class/file
include modulename
#{1+1}
ActionPack
helper method
7. the three "magic columns" are:id - _______ - updated_at
integration
created_at
public
render :partial
8. Rails' application framework
replace the word "scaffold" with the word "model"
include modulename
ActionPack
puts 12.chr
9. Kinds of test you create yourself
validates_numericality_of
integration test
underscore
model
10. to generate regular model code (not scaffolding)
:controller
migration
replace the word "scaffold" with the word "model"
created_at
11. Naming convention for file names
runs its validators
underscores
integration
migration
12. tag that starts a form
<% form_for() %>
singular
#{1+1}
attr_accessor
13. to insert "1 + 1" into a string
the class
data migration (db/migrate/..._create_something.rb)
#{1+1}
helper method
14. The "format" in "repond_to do |format|"? is a ______
a responder object
Structs
runs its validators
<%= yield %>
15. h in in <%=h ... %> is a ______ that escapes special characters to sanitize malicious input
helper method
.:format
replace the word "scaffold" with the word "model"
always public
16. to add an error (called "there was an error") in the validate method
ActionPack
errors.add_to_base("there was an error")
render :partial
put a $ sign in front. For example $x
17. This precedes the "check_logged_in" method in a class
plural
polymorphism
the word "private"
.:format
18. models have only ______names
singular
public
include modulename
validates_numericality_of
19. You add the filter code right after the line introducing __________ in the controller
singular
:controller
the class
errors.add_to_base("there was an error")
20. Methods by default are ________
production
model
rails generate migration AddPhoneToTickets phone:string
public
21. express error messages in a form (do |f|)
the page template
f.error_messages
integration
render :partial
22. The three kinds of tests are: unit and functional and _________ tests
singular
underscores
integration
rails generate migration AddPhoneToTickets phone:string
23. to generate regular model code (not scaffolding)
rake db:migrate
<%= yield %>
rails generate migration AddPhoneToTickets phone:string
replace the word "scaffold" with the word "model"
24. You add the filter code right after the line introducing __________ in the controller
production
the class
integration test
<=> operator
25. to create a migration that adds a "phone" field to the "tickets" table
rails generate migration AddPhoneToTickets phone:string
Modules
replace the word "scaffold" with the word "model"
integration
26. Converts database records to objects
an object-relational mapping library
replace the word "scaffold" with the word "model"
model
a responder object
27. All constants are _______
always public
singular
an object-relational mapping library
:controller
28. Naming convention for classes
CamelCase
polymorphism
ActionPack
.:format
29. Converts database records to objects
ActionPack
an object-relational mapping library
errors.add_to_base("there was an error")
errors.add_to_base("there was an error")
30. These create namespaces
Modules
singular
the page template
model
31. edit routes
ActionPack
underscores
<%= yield %>
config/routes.rb
32. Command to run a migration
validate
rake db:migrate
public
replace the word "scaffold" with the word "model"
33. declaring classes inside another class
render :partial
nested classes
the page template
singular
34. Before it saves or updates data a model object _______
runs its validators
Structs
validates_numericality_of
underscores
35. A script that alters the structure of the underlying database
migration
Tweet.find(2).destroy
rake db:migrate
validates_numericality_of
36. These create namespaces
helper method
Modules
rails generate migration AddPhoneToTickets phone:string
model
37. It generates web pages from page templates
Tweet.find(2).destroy
the class
Embedded Ruby (ERb)
replace the word "scaffold" with the word "model"
38. This method name indicates to rails that it should validate before saving/updating
.:format
ruby make
validate
integration
39. to run the latest migrations
helper method
attr_accessor
rake db:migrate
ActionPack
40. to insert "1 + 1" into a string
attr_accessor
RAILS_ENV (RAILS_ENV=production)
rake db:migrate
#{1+1}
41. Default Rails environments: development - test - ________
integration test
:controller
errors.add_to_base("there was an error")
production
42. a RESTful application uses ... to define an interaction with the data.
integration test
<=> operator
an object-relational mapping library
HTTP methods (post - get - put - delete)
43. It generates web pages from page templates
migration
validates_numericality_of
integration
Embedded Ruby (ERb)
44. All constants are _______
always public
singular
<%= yield %>
rails generate migration AddPhoneToTickets phone:string
45. the second uri indicate
:controller
the word "private"
ActiveRecord
plural
46. Naming convention for file names
the class
underscores
underscore
f.error_messages
47. edit routes
<=> operator
config/routes.rb
underscores
the word "private"
48. controller (and table) names are _______
an object-relational mapping library
integration
plural
data migration (db/migrate/..._create_something.rb)
49. This precedes the "check_logged_in" method in a class
replace the word "scaffold" with the word "model"
the word "private"
integration
underscores
50. This is a comparison operator
polymorphism
HTTP methods (post - get - put - delete)
Structs
<=> operator