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