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. Long form of "rake" which can do more complex things like modifying the database structure and running testsis
ruby make
a responder object
created_at
Tweet.find(2).destroy
2. to include a module inside another class/file
integration test
errors.add_to_base("there was an error")
production
include modulename
3. A search form is not associated with a ______
.:format
f.error_messages
model
a responder object
4. the concept of writing code that can work with objects of multiple types and classes at once
underscore
polymorphism
underscores
<=> operator
5. to generate regular model code (not scaffolding)
#{1+1}
the page template
replace the word "scaffold" with the word "model"
a responder object
6. the second uri indicate
:controller
nested classes
production
render :partial
7. It generates web pages from page templates
Embedded Ruby (ERb)
errors.add_to_base("there was an error")
Structs
singular
8. Default Rails environments: development - test - ________
model
production
<%= yield %>
model
9. the three "magic columns" are:id - _______ - updated_at
validate
rake db:migrate
<=> operator
created_at
10. Rails' object-relational mapping library
rake db:migrate
ActiveRecord
ActionPack
polymorphism
11. These create namespaces
Modules
production
singular
integration
12. to include a module inside another class/file
include modulename
model
underscores
the page template
13. This method name indicates to rails that it should validate before saving/updating
validate
rake db:migrate
polymorphism
underscore
14. to add an error (called "there was an error") in the validate method
errors.add_to_base("there was an error")
validate
the word "private"
production
15. to declare global variables
put a $ sign in front. For example $x
<=> operator
replace the word "scaffold" with the word "model"
rails generate migration AddPhoneToTickets phone:string
16. Unlike regular erb files partials' names begin with an ________
model
underscore
<%= yield %>
errors.add_to_base("there was an error")
17. to create a migration that adds a "phone" field to the "tickets" table
Embedded Ruby (ERb)
ruby make
rails generate migration AddPhoneToTickets phone:string
replace the word "scaffold" with the word "model"
18. to insert "1 + 1" into a string
model
Embedded Ruby (ERb)
#{1+1}
production
19. A special class whose only job is to have attributes and to hold data
puts 12.chr
Structs
a responder object
rake db:migrate
20. Converts database records to objects
CamelCase
an object-relational mapping library
the class
f.error_messages
21. Long form of "rake" which can do more complex things like modifying the database structure and running testsis
rake db:migrate
ruby make
<% form_for() %>
ActionPack
22. All constants are _______
rake db:migrate
an object-relational mapping library
ruby make
always public
23. the second uri indicate
:controller
<%= yield %>
public
model
24. expression that all layouts have
model
created_at
polymorphism
<%= yield %>
25. A script that alters the structure of the underlying database
plural
f.error_messages
migration
the class
26. This method name indicates to rails that it should validate before saving/updating
ActiveRecord
the page template
rake db:migrate
validate
27. to destroy a row with id of 2 using only one line...
Tweet.find(2).destroy
.:format
integration
HTTP methods (post - get - put - delete)
28. to get character from ascii value
puts 12.chr
nested classes
always public
migration
29. a RESTful application uses ... to define an interaction with the data.
config/routes.rb
production
HTTP methods (post - get - put - delete)
validates_numericality_of
30. edit routes
ActiveRecord
config/routes.rb
put a $ sign in front. For example $x
:controller
31. Before it saves or updates data a model object _______
.:format
the class
Modules
runs its validators
32. Rails' object-relational mapping library
integration test
include modulename
ActiveRecord
migration
33. to run the latest migrations
Structs
rake db:migrate
underscore
.:format
34. This is a comparison operator
polymorphism
rake db:migrate
<=> operator
singular
35. a RESTful application uses ... to define an interaction with the data.
HTTP methods (post - get - put - delete)
put a $ sign in front. For example $x
f.error_messages
rake db:migrate
36. This precedes the "check_logged_in" method in a class
the word "private"
an object-relational mapping library
rake db:migrate
underscore
37. The "format" in "repond_to do |format|"? is a ______
a responder object
include modulename
put a $ sign in front. For example $x
the word "private"
38. to get character from ascii value
the class
ruby make
created_at
puts 12.chr
39. Command to run a migration
helper method
rake db:migrate
include modulename
validate
40. h in in <%=h ... %> is a ______ that escapes special characters to sanitize malicious input
helper method
<=> operator
the page template
errors.add_to_base("there was an error")
41. to check if an input is numeric
the word "private"
rake db:migrate
rake db:migrate
validates_numericality_of
42. to get ascii value of a character
:controller
put a $ sign in front. For example $x
puts ?x where x is the character (not variable)
runs its validators
43. to check if an input is numeric
validates_numericality_of
a responder object
ActionPack
migration
44. This precedes the "check_logged_in" method in a class
helper method
the word "private"
Modules
puts 12.chr
45. You add the filter code right after the line introducing __________ in the controller
underscore
replace the word "scaffold" with the word "model"
the class
<% form_for() %>
46. expression that all layouts have
rails generate migration AddPhoneToTickets phone:string
<=> operator
<%= yield %>
runs its validators
47. Unlike regular erb files partials' names begin with an ________
:controller
underscore
include modulename
model
48. The "format" in "repond_to do |format|"? is a ______
ruby make
underscores
a responder object
ActiveRecord
49. A search form is not associated with a ______
HTTP methods (post - get - put - delete)
<% form_for() %>
model
validate
50. edit routes
<% form_for() %>
ActionPack
config/routes.rb
puts 12.chr