Login
Remember
Register
User DavidAnderson
Wall
Recent activity
All questions
All answers
Ask a Question
Questions by DavidAnderson
0
votes
1
answer
Where would this code most likely be found in a Rails project? scope :active, lambda { where(:active => true) }
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Given this code, and assuming @user is an instance of User that has an assigned location, which choice would be used to return the user's city?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
When rendering a partial in a view, how would you pass local variables for rendering?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
What decides which controller receives which requests?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which code would you add to return a 404 to the API caller if the user is not found in the database?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
After this migration has been executed, which statement would be true?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Within a Rails model with a cache_key method, which code snippet will expire the cache whenever the model is updated?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which code sample will skip running the login_required "before" filter on the get_posts controller action?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which choice is an incorrect way to render a partial?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Given two models, what is the issue with the query used to fetch them?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Given this Category model with an attribute for "name", what code would fill in the blank so that it sets saved_name to a string that is the category name that existed before the name was changed?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Given a table of blog_posts and a related table of comments (comments made on each blog post), which ActiveRecord query will retrieve all blog posts with comments created during @range?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which choice is not a valid Rails route?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
If User is an ActiveRecord class, which choice would be expected to return an array?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which part of the Rails framework is primarily responsible for making decisions about how to respond to a browser request?
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
If the only route defined is resources :products, what is an example of a URL that could be generated by this link_to method? link_to('Link', {controller: 'products', action: 'index', page: 3})
asked
Sep 3, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
If a product has a user-uploadable photo, which ActiveStorage method should fill in the blank? class Product << ApplicationRecord ____ :photo end
asked
Sep 3, 2022
in
Ruby
ruby-on-rail
0
votes
1
answer
How would you validate that a project's name is not blank, is fewer than 50 characters, and is unique?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
What is the correct syntax for inserting a dynamic title tag into the header of your page from within an ERB view template?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which choice best describes the expected value of @result? @result = Article.first.tags.build(name: 'Urgent')
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
What is the correct way to assign a value to the session?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which statement about ActiveRecord models is true?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
There is a bug in this code. The logout message is not appearing on the login template. What is the cause?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which HTML is closes to what this code would output? <% check_box(:post, :visible) %>
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
You made a spelling mistake while creating a table for bank accounts. Which code would you expect to see in a migration to fix the error?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Review the code below. Which Ruby operator should be used to fill in the blank so that the sort method executes properly?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
In a Rails controller, what does the code params.permit(:name, :sku) do?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
In the model User you have the code shown below. When saving the model and model.is_admin is set to true, which callback will be called?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
Which Rails helper would you use in the application view to protect against CSRF (Cross-Site Request Forgery) attacks?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
0
votes
1
answer
What part of the code below causes the method #decrypt_data to be run?
asked
Sep 2, 2022
in
Ruby
ruby-on-rails
Page:
« prev
1
...
65
66
67
68
69
70
71
72
73
74
75
...
123
next »
...