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