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