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