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. Before it saves or updates data a model object _______
runs its validators
<% form_for() %>
#{1+1}
public
2. edit routes
config/routes.rb
<=> operator
rake db:migrate
Modules
3. Naming convention for classes
.:format
CamelCase
the word "private"
rake db:migrate
4. to specify a format like html or xml in routes.rb
model
.:format
created_at
render :partial
5. to run the latest migrations
public
Embedded Ruby (ERb)
<=> operator
rake db:migrate
6. Rails' object-relational mapping library
created_at
Embedded Ruby (ERb)
ActiveRecord
rake db:migrate
7. Embedded Ruby (ERb) processes data from model objects AND _______ as inputs
the page template
polymorphism
HTTP methods (post - get - put - delete)
polymorphism
8. to create a migration that adds a "phone" field to the "tickets" table
errors.add_to_base("there was an error")
rails generate migration AddPhoneToTickets phone:string
render :partial
ruby make
9. Allows instance variables to be accessible outside the class by defining = operators for variables
Tweet.find(2).destroy
attr_accessor
the word "private"
the page template
10. Before it saves or updates data a model object _______
rails generate migration AddPhoneToTickets phone:string
polymorphism
runs its validators
config/routes.rb
11. Unlike regular erb files partials' names begin with an ________
.:format
underscore
integration
public
12. Command to run a migration
rails generate migration AddPhoneToTickets phone:string
attr_accessor
rake db:migrate
Structs
13. to insert "1 + 1" into a string
an object-relational mapping library
Structs
#{1+1}
<=> operator
14. to get ascii value of a character
HTTP methods (post - get - put - delete)
RAILS_ENV (RAILS_ENV=production)
puts ?x where x is the character (not variable)
a responder object
15. the model-generator command create the model class (app/models/something.rb) and the ____________
attr_accessor
data migration (db/migrate/..._create_something.rb)
production
runs its validators
16. A special class whose only job is to have attributes and to hold data
validates_numericality_of
Structs
underscores
include modulename
17. Naming convention for classes
render :partial
puts ?x where x is the character (not variable)
CamelCase
rake db:migrate
18. All constants are _______
a responder object
always public
validates_numericality_of
Structs
19. a RESTful application uses ... to define an interaction with the data.
validates_numericality_of
HTTP methods (post - get - put - delete)
plural
underscores
20. h in in <%=h ... %> is a ______ that escapes special characters to sanitize malicious input
helper method
put a $ sign in front. For example $x
a responder object
nested classes
21. Converts database records to objects
nested classes
the word "private"
ActionPack
an object-relational mapping library
22. Rails' object-relational mapping library
nested classes
ActiveRecord
created_at
<%= yield %>
23. expression that all layouts have
created_at
errors.add_to_base("there was an error")
<%= yield %>
helper method
24. Naming convention for file names
<=> operator
rake db:migrate
model
underscores
25. This method name indicates to rails that it should validate before saving/updating
ruby make
validate
Modules
render :partial
26. to call a partial
errors.add_to_base("there was an error")
Modules
render :partial
Modules
27. Embedded Ruby (ERb) processes data from model objects AND _______ as inputs
include modulename
HTTP methods (post - get - put - delete)
the page template
validate
28. to check if an input is numeric
integration
validates_numericality_of
integration test
helper method
29. declaring classes inside another class
migration
nested classes
the word "private"
puts 12.chr
30. to call a partial
nested classes
f.error_messages
:controller
render :partial
31. models have only ______names
:controller
config/routes.rb
the word "private"
singular
32. Rails' application framework
#{1+1}
.:format
:controller
ActionPack
33. a RESTful application uses ... to define an interaction with the data.
the page template
created_at
include modulename
HTTP methods (post - get - put - delete)
34. to check if an input is numeric
the word "private"
put a $ sign in front. For example $x
:controller
validates_numericality_of
35. Default Rails environments: development - test - ________
#{1+1}
ActionPack
production
helper method
36. the second uri indicate
:controller
model
<%= yield %>
underscores
37. You add the filter code right after the line introducing __________ in the controller
runs its validators
the class
nested classes
integration test
38. express error messages in a form (do |f|)
migration
singular
f.error_messages
underscores
39. to destroy a row with id of 2 using only one line...
model
<=> operator
Tweet.find(2).destroy
errors.add_to_base("there was an error")
40. The three kinds of tests are: unit and functional and _________ tests
integration
nested classes
replace the word "scaffold" with the word "model"
config/routes.rb
41. These create namespaces
data migration (db/migrate/..._create_something.rb)
ActionPack
Modules
puts ?x where x is the character (not variable)
42. Converts database records to objects
puts ?x where x is the character (not variable)
puts ?x where x is the character (not variable)
CamelCase
an object-relational mapping library
43. These create namespaces
rails generate migration AddPhoneToTickets phone:string
Modules
production
validate
44. Default Rails environments: development - test - ________
production
replace the word "scaffold" with the word "model"
model
puts 12.chr
45. This variable changes the environment
RAILS_ENV (RAILS_ENV=production)
attr_accessor
polymorphism
ActionPack
46. This method name indicates to rails that it should validate before saving/updating
singular
#{1+1}
the class
validate
47. to run the latest migrations
the class
.:format
data migration (db/migrate/..._create_something.rb)
rake db:migrate
48. Kinds of test you create yourself
<=> operator
integration test
rake db:migrate
migration
49. to add an error (called "there was an error") in the validate method
Modules
ActionPack
errors.add_to_base("there was an error")
include modulename
50. Unlike regular erb files partials' names begin with an ________
created_at
underscore
attr_accessor
production