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