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