2,094 questions
0
votes
0
answers
26
views
Mechanize not getting a site
while using Mechanize gem in rails and fetching the site https://www.reuters.com/ its giving -> Failed to fetch page:
401 => Net::HTTPUnauthorized for https://www.reuters.com/ -- WWW-...
2
votes
1
answer
72
views
Multi DB Access In Rails 6 + Heroku
There is a Rails 5 application that runs in Heroku; it has two DBs, a Primary and a Follower (read-only), the follower is the replica of the Primary. In some application areas, we use followers to get ...
0
votes
0
answers
113
views
Problem with ActiveRecord-Session_store gem when starting up Rails 6 app
I'm upgrading a Rails app from v5 to v6.1.7 (ruby:2.7.7), but I have a problem with active_record_store for sessions at start up when running locally in Docker.
I've installed the 'activerecord-...
0
votes
1
answer
188
views
Docker Compose, Rails 6, and Webpack Development Server for Development Environment
I am attempting to use webpack-dev-server with my Rails 6 application, and using the configuration below, I am getting some odd behavior.
When I change an asset file, the webpack container does run, ...
1
vote
0
answers
46
views
Rails globalize error undefined method `translates' for Post:Class
I am using rails 6.1.4 and added transalations table to post via this migration
class TransalatePosts < ActiveRecord::Migration[6.1]
def change
def self.up
Post.create_translation_table!...
0
votes
1
answer
137
views
Rails lockbox and blind index, unable to access encrypted field
I have lockbox v1.3.3 / blind index v2.3.2 gems installed (have to use this version, can't upgrade at the moment).
I am using rails 6.0.3.2 and ruby 2.6.9.
I followed these steps:
https://ankane.org/...
0
votes
1
answer
109
views
invitation_accepted? returns FALSE in after_invitation_accepted CALLBACK
I use devise_invitable (2.0.6)
invitation_accepted? returns FALSE in after_invitation_accepted CALLBACK but when I pause here and check in rails console it gives me true for invitation_accepted?
user....
1
vote
0
answers
94
views
Rails 6 - <%= link_to %> Is Not Opening Modal to Confirm Deletion and Just Deleting, How to Ensure Confirmation Before Deletion?
I'm currently facing a problem in my project. I'm on Rails 6.0.4.8 and Ruby 2.6.8.
The issue I'm running into is that I would like a user to be able to delete a notes record by clicking on an icon but ...
0
votes
1
answer
69
views
ActionController::ParameterMissing in StaticPagesController#contact (Ruby on Rails 6)
How to solve this missing params?
StaticPagesController:
class StaticPagesController < ApplicationController
def home
end
def about
@hero_title = 'about_us'
end
def services
@...
1
vote
1
answer
137
views
Rails | Use Nested Attribute as Foreign Type For Polymorphic Association?
In Rails, I would like to structure my models such that the main record (lets call it Shipment) has a detail record (base type: ShipmentDetail) that is polymorphic such that the structure of the data ...
0
votes
1
answer
93
views
log error with passenger in rails 6 app : set PASSENGER_COMPILE_NATIVE_SUPPORT_BINARY=0 to disable
I have a rails 6 app, working fine, using passenger with nginx, but there is log error like this :
App 759213 output: [passenger_native_support.so] trying to compile for the current user (www-data) ...
0
votes
1
answer
54
views
My Rails Controller Spec is Not Passing When a Redirect Happens
I'm using rails 6 and ruby 3.1.1 and Rspec
It's been a minute since I've written tests, so the syntax is a bit new to me, but "I think" I understand it. A controller create test is not ...
1
vote
1
answer
544
views
wrong number of arguments (given 2, expected 1) in Rails
module ApplicationHelper
def t(*a)
translate(*a)
end
end
Case 1 :- t('views.home.welcome_updated', default: 'Updated') => Getting Error: (wrong number of arguments (given 2, expected 1))
...
1
vote
0
answers
52
views
Rails option_for_select how to show a combination of two-fields of hash in drop-down
rails 6.1, ruby 3.1.1
On a form (form_for) I have a drop-down select box using options_for_select in my :sort_order field. It takes a hash and is currently showing colors as the options text, which ...
1
vote
2
answers
292
views
js requests to Rails 6.0 app render html template instead of js
I'm in the process of migrating a legacy Rails 5.0 app to (hopefully) 7.x. I got to 5.2.x without too much trouble. I'm currently trying to upgrade to 6.0 and I have a problem with controller actions ...
0
votes
2
answers
54
views
Stripe plan update URI::InvalidURIError
I create an update method based on the creation, the only difference is in changing the stripe method, but unfortunately I get an error, although the logic is identical
update_feature_plans_job.rb
...
0
votes
0
answers
20
views
can't add gem "devise" to ruby on rails 6 project [duplicate]
When I included gem devise in my project and wrote the bundle install command to the console, in order to install all the gems in my project, I got the following error:
An error occurred while ...
1
vote
1
answer
184
views
Rails 6 | Mass Attribute Assignment Without Protection?
I am attempting to work-around a performance issue with a 3rd party library (acts_as_taggable_on). For the one model that uses this extension, it has a N+1 Query problem where it will make one or more ...
2
votes
0
answers
1k
views
No unique index found for id
I have faced an error "No unique index found for id" while trying to use Upsert all. But isn't ID a unique index by default? Initially we have created our application in rails 3 and now we ...
0
votes
1
answer
907
views
Rails 6.1 multiple read replicas
Our Rails app has some operations with very high database load on Postgres views, which we would like to spread out across multiple replicas. The docs initially suggest that any given model can only ...
0
votes
1
answer
130
views
create mysql functions or stored procedure from a rake task
I'm trying to create functions and stored procedures inside RoR project MySql database, these objects are needed for me to import historic data from the old platform the customer is actually running......
0
votes
0
answers
65
views
Rails 6: "Unable to autoload constant" error with POST request to nested controller
Description:
I'm using Rails 6 for my application, and I've encountered an issue when making a POST request to a nested controller. Specifically, when I try to submit a POST request to localhost:3000/...
1
vote
3
answers
244
views
Rails rescue_from handler function is getting called in the end
I have a Rails 6 application.
class PostsController
rescue_from MyException, :handle_my_exception
around_action :my_around_action
def create
Rails.logger.info "Executing create code&...
0
votes
1
answer
358
views
Search Products by Tags in Shopify via GraphQL in Rails
I am using rails Shopify API and using Storefront API to get the products from Shopify. We have a lot of tags applied on every product. I want to get all the products that include the tags, either &...
1
vote
1
answer
39
views
Active_scaffold record created message : Created #<Docket:0x0000013800ec4df0>
I'm using Rails 6.1.7 and active_scaffold latest version with a very basic tutorial one model app, I get this message on the form top when a record is created:
Created #<Docket:0x0000013800ec4df0&...