Category "ruby-on-rails"

Rails SQL "select in" across several columns: where (code1, code2) in (("A", 1), ("A", 3), ("Q", 9))

I have a business requirement to select records based on two fields in one table: code1 and code2. The selection is complex and hard-coded, with no codeable rhy

Adding inline image with Caracal in Ruby on Rails

I'm trying to get text to show up in-line with an image using the Caracal ruby gem. It currently does this: But I need it to instead do this instead: (accom

Exception: ActionDispatch::Http::MimeNegotiation::InvalidType

I have error report in Sentry. How can I fix it? ActionDispatch::Http::MimeNegotiation::InvalidType {#context['com.opensymphony.xwork2.dispatcher.httpservletres

Rollback entire transaction within nested transaction

I want a nested transaction to fail the parent transaction. Lets say I have the following model class Task < ApplicationRecord def change_status(status,

How to use jqueryUI in a rails 6 or rails 7 alpha engine

I would be grateful if someone could show the exact steps needed to use jquery ui in a rails 6 or rails 7 Alpha 2 engine. I have been unable to get either impor

How to use jqueryUI in a rails 6 or rails 7 alpha engine

I would be grateful if someone could show the exact steps needed to use jquery ui in a rails 6 or rails 7 Alpha 2 engine. I have been unable to get either impor

Errno::ECONNRESET: Connection reset by peer in Rails using rest-client

We have a Ruby on Rails application and this has a "search" functionality (search for some company). From browser user key-in some name and hit search and this

How to set up importmap-rails in Rails 7 engine?

I have opened an issue in the importmap-rails gem github repository here about this but thought I'd throw the question out here in case anyone might have a work

Rails Query group and pluck to Return Array of IDs grouped by another attribute?

I know that Model.group(:account_id).count will return a hash of account_ids => counts. {3=>3, 4=>3, 8=>8, 10=>5, 20=>4} I'd like to retur

Why can't I display my ruby on rails app on localhost?

I'm trying to display a very simple app from codecademy and this is the error I'm getting in my browser: PagesController#welcome is missing a template for requ

Can I slugignore `node_modules`, `tmp` and `storage` folders?

I want ways to reduce my slug size, and I was wondering if it will be ok to ignore those folders /node_modules, /storage, /tmp, or will that bring me some issue

Setting session timeout in Rails 6

I need help on the timeout configuration on the rails 6. I tried to configure the /config/initializers/devise.rb, but it's not working, any assist will be appre

get or post within ActionCable tests in Rails 6?

I am using a JWT to authenticate my user. So when a user want to connect to the ActionCable server, it does something like this: Get a JWT from REST endpoint:

Add Buttons to Rails ActionText toolbar

What is the best way to configure ActionText to add buttons to the toolbar. For example, an h2 and h3 button?

Getting Jquery and Bootstrap to work with Rails 6

I am a new to rails and struggling to get Jquery and Bootstrap to work with Rails 6. I think it has something to do with switching the app from rails 5 to rails

mimemagic install error: "Could not find MIME type database in the following locations..." on Windows [duplicate]

I am running into the following error when trying to install mimemagic 0.3.10 in a Ruby on Rails project. Note that it is run on a Windows env

response checksum or hash not matching in payumoney?

When notification is passed to the app after payumoney processing it sends response hash and we need to compute the hash and match it with the passed in respons

Rails: validate uniqueness of two columns (together)

I have a Release model with medium and country columns (among others). There should not be releases that share identical medium/country combinations. How would

Error while doing mina setup

I am using mina to deploy my rails app. I am using aws with nginx and rvm. Whenever I do mina setup I get Permission denied (publickey). ! Command f

Capistrano deployment error in rails application

I am getting this error on doing cap production deploy in my rails application my net-ssh version is 5.0.2 can anyone please help me how i can fix this. My serv