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