Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
Ruby Interview Questions and Answers
Home
Questions
Ruby
0
votes
How do you add Ruby code inside Rails views and have its result outputted in the HTML file?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
A way that views can share reusable code, such as formatting a date, is called a _?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
What is a standard prerequisite for implementing Single Table Inheritance (STI)?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
Where would this code most likely be found in a Rails project? scope :active, lambda { where(:active => true) }
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
When rendering a partial in a view, how would you pass local variables for rendering?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
What decides which controller receives which requests?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
After this migration has been executed, which statement would be true?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
Which code sample will skip running the login_required "before" filter on the get_posts controller action?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
Which choice is an incorrect way to render a partial?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
Given two models, what is the issue with the query used to fetch them?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
Which choice is not a valid Rails route?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
If User is an ActiveRecord class, which choice would be expected to return an array?
asked
Sep 3, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rail
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
Which choice best describes the expected value of @result? @result = Article.first.tags.build(name: 'Urgent')
asked
Sep 2, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
What is the correct way to assign a value to the session?
asked
Sep 2, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
Which statement about ActiveRecord models is true?
asked
Sep 2, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
Which HTML is closes to what this code would output? <% check_box(:post, :visible) %>
asked
Sep 2, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
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
by
DavidAnderson
ruby-on-rails
0
votes
In a Rails controller, what does the code params.permit(:name, :sku) do?
asked
Sep 2, 2022
in
Ruby
by
DavidAnderson
ruby-on-rails
Page:
1
2
3
4
5
next »
...