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