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