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