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