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