.how do you start a loop that reads through the array object "@ads"?
1.a web page
2.ruby make
3.for ad in @ads
4.ActionPack
Posted Date:-2022-08-22 13:32:49
.if looping through “f†object, how do you make a text field “name�
1.<%= yield %>
2.… have the same URL
3.<% form_for() %>
4. <%= f.text_field :name %>
Posted Date:-2022-08-22 13:28:41
.what are the three "magic columns"
1. id, created_at, updated_at
2.render :partial:id
3.integration test
4.rake db:migrate:id:delete
Posted Date:-2022-08-22 13:10:43
.what does "rake" mean?
1.#{1+1}
2.singular
3.ruby make
4.flight_id
Posted Date:-2022-08-22 13:30:55
.what's the difference between model names and controller names?
1.the method within the controller to call
2.the data being presented by the web page
3. model names are singular, controller (and table) names are plural d)
4.in the controller: respond_to do |format| ... end
Posted Date:-2022-08-22 10:26:37
.when data is retrieved from the database, what does Rails turn it into?
1.a responder object
2.validate
3.flight_id
4.an object
Posted Date:-2022-08-23 06:13:15
.why should partials generally use local variables?
1.because they make the partial less dependent on other code
2.the data being presented by the web page
3.their names begin with an underscore
4.the request parameters table
Posted Date:-2022-08-22 13:04:50
a RESTful application uses ... to define an interaction with the data.
1.a responder object
2.it is not associated with a model
3. HTTP methods (post, get, put, delete) d)
4.the request parameters table
Posted Date:-2022-08-22 13:24:50
converts database records to objects is called -------------.
1.for ad in @ads
2.integration test
3.Representational State Transfer
4. an object-relational mapping library
Posted Date:-2022-08-22 10:31:20
do models have singular or plural names?
1.controller
2.CamelCase
3.flight_id
4.singular
Posted Date:-2022-08-22 13:05:32
how do partials look compared to regular erb files?
1.underscores
2.it runs its validators
3.it is not associated with a model
4. their names begin with an underscore
Posted Date:-2022-08-22 13:02:26
how do you add an error (called "there was an error") in the validate method?
1.redirect_to " ... "
2. errors.add_to_base("there was an error")
3.the word "private"
4.their names begin with an underscore
Posted Date:-2022-08-23 05:59:09
how do you ask for all records of the Ads table?
1.singular
2.@ads = Ad.find(:all)
3.validate
4.rake db:migrate
Posted Date:-2022-08-23 06:10:44
how do you call a partial?
1.a web page
2.underscores
3.singular
4. render :partial
Posted Date:-2022-08-23 06:00:18
how do you create a migration that adds a "phone" field to the "tickets" table?
1.unit, functional, and integration tests
2.RAILS_ENV (RAILS_ENV=production)
3.integration test
4. rails generate migration AddPhoneToTickets phone:string
Posted Date:-2022-08-22 10:06:44
how do you express error messages in a form (do |f|)?
1.ruby make
2. f.error_messages
3.for ad in @ads
4.underscores
Posted Date:-2022-08-22 13:09:34
how do you generate regular model code (not scaffolding)?
1.just replace the word "scaffold" with the word "model"
2.it is not associated with a model
3.username == "admin" && password == "some_password"
4.do |f| (where "f" can be anything)
Posted Date:-2022-08-22 12:55:52
how do you run a migration?
1.CamelCase
2.ruby make
3.an object
4. rake db:migrate
Posted Date:-2022-08-22 10:12:33
how do you run the latest migrations?
1.ruby make
2.a web page
3. rake db:migrate
4.CamelCase
Posted Date:-2022-08-23 06:01:41
how do you specify a format like html or xml in routes.rb?
1.format (that period is a concatenation period)
2.HTTP methods (post, get, put, delete)
3.their names begin with an underscore
4.unit, functional, and integration tests
Posted Date:-2022-08-22 10:18:59
how do you update?
1.update_attributes (as in @ad.update_attributes(params[:ad]))
2.unit, functional, and integration tests
3.format (that period is a concatenation period)
4.it is not associated with a model
Posted Date:-2022-08-22 10:14:55
how does "rake" differ from "ruby"?
1.right after the line introducing the class in the controller
2.a script that alters the structure of the underlying database
3. it can do more complex things like modifying the database structure and running tests
4.expression is ruby code that prints out a value in html
Posted Date:-2022-08-22 13:03:29
how does Rails choose to correct format to generate?
1. in the controller: respond_to do |format| ... end
2.it is not associated with a model
3.redirect_to " ... "
4.the data being presented by the web page
Posted Date:-2022-08-22 13:08:07
how does rake tell which migrations have been run and which have not?
1.rails generate migration AddPhoneToTickets phone:string
2.rails records the latest timestamp of all the migrations it runs (and runs only the latest ones)
3.because they make the partial less dependent on other code
4.it can do more complex things like modifying the database structure and running tests
Posted Date:-2022-08-22 13:07:15
how should you order routes?
1.just replace the word "scaffold" with the word "model"
2. from general to specific ('/ads/' and then '/ads/:id')
3.rails generate migration AddPhoneToTickets phone:string
4.do |f| (where "f" can be anything)
Posted Date:-2022-08-22 12:57:55
how would you insert "1 + 1" into a string?
1.CamelCase
2.#{1+1}
3.singular
4.validate
Posted Date:-2022-08-23 06:05:46
if the table Seats is associated with the table Flights, how should you name the table column in Seats to indicate its flight?
1.an object
2.flight_id
3.ruby make
4.#{1+1}
Posted Date:-2022-08-23 06:04:43
Rails' application framework is called ----------?
1.ActionPack
2.ActiveRecord
3.a web page
4.an object
Posted Date:-2022-08-22 10:11:52
representation of a resource is called -------------.
1.CamelCase
2.ruby make
3. a web page
4.ActionPack
Posted Date:-2022-08-22 10:30:21
Ruby on Rails Multiple choice Questions
1.runs State test
2.the request State Transfer
3.Representational State Transfer
4.runs State Transfer
Posted Date:-2022-08-23 05:57:22
to add login security, which two pieces of code do you need?
1.1.all important data is a resource2. every resource has a proper name (URL)
2.:format (that period is a concatenation period)
3.the method within the controller to call
4. 1. login method (that checks a username and password) and 2. a filter (that calls the login method when needed)
Posted Date:-2022-08-22 13:01:37
to create scafolding for "thing" data, run...
1.because they make the partial less dependent on other code
2.expression is ruby code that prints out a value in html
3.just replace the word "scaffold" with the word "model"
4.rails generate scaffold thing <column name 1>:<column type1> <column name 2>:<column type2>
Posted Date:-2022-08-22 13:19:50
what checks if an input is numeric?
1.integration test
2.Fa responder object
3.validate
4.validates_numericality_of
Posted Date:-2022-08-22 10:32:37
what comes after <% form_for()... ?
1.redirect_to " ... "
2.the request parameters table
3.<%= f.text_field :name %>
4.do |f| (where "f" can be anything)
Posted Date:-2022-08-22 10:15:48
what comes after "def check_logged_in" line for site "ads"?
1.in the controller: respond_to do |format| ... end
2.errors.add_to_base("there was an error")
3.format (that period is a concatenation period)
4.authenticate_or_request_with_http_basic("Ads") do |username, password|
Posted Date:-2022-08-22 13:15:36
what does "show" refer to as the :action value?
1.the method within the controller to call
2.HTTP methods (post, get, put, delete)
3.the data being presented by the web page
4.their names begin with an underscore
Posted Date:-2022-08-22 10:13:37
what does a model object do before it saves or updates data?
1.underscores
2. it runs its validators
3.validate
4.rake db:migrate
Posted Date:-2022-08-22 13:29:47
what does Embedded Ruby (ERb) process as inputs?
1. data from model objects AND the page template
2.HTTP methods (post, get, put, delete)
3.it is not associated with a model
4.their names begin with an underscore
Posted Date:-2022-08-22 13:34:38
what does the "h" in <%=h ... %> mean?
1.:format (that period is a concatenation period)
2.h is a helper method that escapes special characters to sanitize malicious input
3.a script that alters the structure of the underlying database
4.the method within the controller to call
Posted Date:-2022-08-22 10:24:23
what environments does Rails have by default?
1.development, test, production
2.render :partial
3.RAILS_ENV (RAILS_ENV=production)
4.integration test
Posted Date:-2022-08-22 12:54:48
what expression do all layouts have?
1. <%= yield %>
2.<% form_for() %>
3.integration test
4.<%= f.text_field :name %>
Posted Date:-2022-08-23 06:03:48
what generates web pages from page templates?
1.underscores
2. Embedded Ruby (ERb)
3.a web page
4.render :partial
Posted Date:-2022-08-22 13:25:55
what is "format" in "repond_to do |format|"?
1.underscores
2.an object
3. a responder object
4.integration test
Posted Date:-2022-08-22 13:37:08
what is "migration"?
1.It is a format (that period is a concatenation period)
2.a script that alters the structure of the underlying database
3.their names begin with an underscore
4.the data being presented by the web page
Posted Date:-2022-08-22 10:27:27
What is bundler?
1.rails generate scaffold User name:string email:string
2.self-contained bundles of gems. Useful for versioning.
3. Edit Gemfile, then run 'bundle install' or just 'bundle'.
4.Ruby Version Manager. Install and manage multiple versions of Ruby.
Posted Date:-2022-08-22 10:01:19
What is gem?
1.rails generate scaffold User name:string email:string
2.self-contained packages of Ruby code
3.self-contained bundles of gems. Useful for versioning.
4.Ruby Version Manager. Install and manage multiple versions of Ruby.
Posted Date:-2022-08-22 10:03:25
What is gemset?
1.self-contained bundles of gems. Useful for versioning.
2.self-contained packages of Ruby code
3.Ruby Version Manager. Install and manage multiple versions of Ruby.
4.rails generate scaffold User name:string email:string
Posted Date:-2022-08-22 10:02:19
what is naming convention for classes?
1.ActionPack
2.CamelCase
3.ruby make
4.a web page
Posted Date:-2022-08-22 13:17:36
what is naming convention for file names ?
1.ActiveRecord
2.underscores
3.an object
4.validate
Posted Date:-2022-08-22 13:21:47
what is params[...]?
1.have the same URL of a table b)
2.the word "private"
3.a responder object
4. the request parameters table
Posted Date:-2022-08-22 13:12:51
what is Rails' object-relational mapping library?
1.CamelCase
2.ActiveRecord
3.an object
4.underscores
Posted Date:-2022-08-22 10:33:38
what is Rails' object-relational mapping library?
1.CamelCase
2.ActiveRecord
3.an object
4.underscores
Posted Date:-2022-08-22 12:34:09
What is rake?
1.self-contained bundles of gems. Useful for versioning.
2.bundle exec rake db:migrate. Using bundle exec ensures that the rake version in our Gemfile is used.
3.rails generate scaffold User name:string email:string
4.Ruby Version Manager. Install and manage multiple versions of Ruby.
Posted Date:-2022-08-22 10:05:45
What is rvm?
1.rails generate scaffold User name:string email:string
2. Ruby Version Manager. Install and manage multiple versions of Ruby.
3.self-contained bundles of gems. Useful for versioning.
4.self-contained packages of Ruby code
Posted Date:-2022-08-22 10:10:27
what is scaffold command?
1.rails generate scaffold User name:string email:string
2.Ruby Version Manager. Install and manage multiple versions of Ruby.
3.self-contained packages of Ruby code
4.self-contained bundles of gems. Useful for versioning.
Posted Date:-2022-08-22 10:04:19
what is scriptlet versus expression
1.it runs its validators
2.it is not associated with a model
3.Representational State Transfer
4. expression is ruby code that prints out a value in html
Posted Date:-2022-08-22 10:23:21
what is the filter code that calls on the "check_logged_in" method for only the "edit" and "update" methods?
1.the data being presented by the web page
2.HTTP methods (post, get, put, delete)
3.data from model objects AND the page template
4. before_filter :check_logged_in, :only => [:edit, :update]
Posted Date:-2022-08-22 10:29:36
what is the second uri indicate?
1.an object
2.ActionPack
3.CamelCase
4.controller
Posted Date:-2022-08-23 06:06:29
what kind of test do you create yourself?
1.an object
2.ActionPack
3.rake db:migrate
4. integration test
Posted Date:-2022-08-22 13:35:50
what kind of tests are there?
1.unit, functional, and integration tests
2.it is not associated with a model
3.id, created_at, updated_at
4.it runs its validators
Posted Date:-2022-08-22 10:17:28
what method name indicates to rails that it should validate before saving/updating?
1.validate
2.ActionPack
3.flight_id
4.ruby make
Posted Date:-2022-08-23 06:09:09
what parameters are in <% form_for() %>?
1.data from model objects AND the page template
2. form_for(@object, :url=>{:action=>'create'})
3.:format (that period is a concatenation period)
4.do |f| (where "f" can be anything)
Posted Date:-2022-08-23 05:58:16
what precedes the "check_logged_in" method in a class?
1.the request parameters table
2. the word "private"
3.<% form_for() %>
4.redirect_to " ... "
Posted Date:-2022-08-23 06:07:38
what scripts does the model-generator command create?
1.their names begin with an underscore
2. the model class (app/models/something.rb) and the data migration (db/migrate/..._create_something.rb)
3.model names are singular, controller (and table) names are plural
4.rails generate migration AddPhoneToTickets phone:string
Posted Date:-2022-08-22 13:33:47
what should you write in routes.rb to give meaning to http://mebay.com/ads/3?
1.from general to specific ('/ads/' and then '/ads/:id')
2.map.connect '/ads/:id', :controller=>'ads', :action=>'show'
3.include test.xml to root of "public" folder and ,render (:partial=>'map', :locals=>{:data=>'/test.xml'})
4.form_for(@object, :url=>{:action=>'create'})
Posted Date:-2022-08-22 13:00:52
what steps get you from fild.erb to file.html?
1.data from model objects AND the page template
2.erb -> Embedded Ruby -> ruby code (file.rb) -> fild.html
3.the method within the controller to call
4.the data being presented by the web page
Posted Date:-2022-08-22 10:28:11
what tag starts a form?
1.integration test
2.<%= f.text_field :name %>
3. <% form_for() %>
4.<%= yield %>
Posted Date:-2022-08-22 13:11:48
what variable changes the environment?
1.RAILS_ENV (RAILS_ENV=production)
2.development, test, production
3.render :partial d)
4.validates_numericality_of
Posted Date:-2022-08-22 13:20:58
what's special about a search form?
1.for ad in @ads
2. it is not associated with a model
3.Representational State Transfer
4.it runs its validators
Posted Date:-2022-08-23 06:03:01
when you put something into an array, does the array keep a separate copy?
1. no. arrays just keep references to objects stored in memory.
2.the data being presented by the web page
3.it is not associated with a model
4.the request parameters table
Posted Date:-2022-08-22 10:20:08
where do you add the filter code?
1.rails generate migration AddPhoneToTickets phone:string
2.the data being presented by the web page
3.data from model objects AND the page template
4. right after the line introducing the class in the controller
Posted Date:-2022-08-22 12:35:26
where do you edit routs?
1.controller
2.underscores
3.ActiveRecord
4.config/routes.rb
Posted Date:-2022-08-22 13:26:54
which two steps to include test.xml data to the partial "map" (via the variable "data")...?
1.from general to specific ('/ads/' and then '/ads/:id')
2.include test.xml to root of "public" folder and , render (:partial=>'map', :locals=>{:data=>'/test.xml'})
3.just replace the word "scaffold" with the word "model"
4.login method (that checks a username and password) and , a filter (that calls the login method when needed)
Posted Date:-2022-08-22 12:38:42
why do you only need to call "render" in the controller sometimes and not always?
1..:format (that period is a concatenation period)
2.redirect_to " ... "
3.errors.add_to_base("there was an error")
4. if you're happy with the default template, you can omit "render"
Posted Date:-2022-08-22 13:23:36
why is it good to redirect after inserting info into the database?
1.unit, functional, and integration tests
2.a script that alters the structure of the underlying database
3. so that users can't accidentally resubmit information by refreshing the page
4.the data being presented by the web page
Posted Date:-2022-08-22 12:37:36