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