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