Questions tagged [ruby-on-rails]

0 votes
1 replies
Ruby on Rails test and console both exit with cache_control error
I'm stumped. rails test and rails console suddenly stopped working for my project and I can't find any recent changes I've made to cause the prob...
asked 4 months ago
0 votes
1 replies
“transaction do” without explicit receiver
According to the docs, in Rails models, transactions are made on either classes descending from ActiveRecord::Base or any instance of such a clas...
0 votes
0 replies
star rating and ratyrate: is Devise necessary? [closed]
I would like to implement a star rating capability in my project, possibly using a ruby gem, and found documentation on ratyrate. I tried to get...
asked 4 months ago
0 votes
0 replies
Rollback from scss to css version stays under scss
I registered in a commit my version under .css to try to transform it with under .scss. I first replaced all "css" words/parts of words of the a...
asked 4 months ago
0 votes
1 replies
Enviornment broken after uninstalling Rails 6.0.0.rc1
I ran gem uninstall rails -v 6.0.0.rc1 gem uninstall railties -v 6.0.0.rc1 and even rvm remove ruby-2.6.1 then reinstalled ruby, created a new ge...
asked 4 months ago
0 votes
1 replies
Rails crop image with start point, width, and height
I have a Ruby/Rails app and I 'm wondering if there is a way to crop an image starting at the top left point, and specifyinga width, height and...
asked 4 months ago
0 votes
1 replies
Getting Globalize and autocomplete to work together
Using globalize gem to manage translations with autocomplete, there is a situation where a number of hooks need to be properly set. Note: this do...
0 votes
2 replies
How to get current user in Rails model
I am using Rails 5.2 for my application and sidekiq for processing the background job. class Document < ApplicationRecord has_many :documen...
asked 4 months ago
1 votes
1 replies
How to escape special symbols in “term” query
I try to find records in elastic using "term". Like this: bool: { must: [ {term: {"contexts.key": "resource"}},...
asked 4 months ago
0 votes
1 replies
HTTP 503 due to: Request queue full (configured max. size: 100) apache + passanger
I am using ruby on rails with phusion passenger with apache and I am getting below error. Sometime my server is hangged and ssh login not working...
0 votes
1 replies
rails migrations changed unrelated columns
I ran migrations which did not touch a given table in any way. After running it, 3 foreign keys which reference that table were removed and their...
asked 4 months ago
0 votes
0 replies
Ruby on Rails ActionCable: Should I manually close a connection in case of an authentication token expiration?
We use token-based authentication for our application. Token lifetime is limited. The flow is clear for a plain HTTP API -- the token gets verif...
0 votes
1 replies
Convert simple text into html honoring newlines whitespaces and tabs
Writing a method to convert simple text file into html so that it can be integrated inside ckeditor. However we are unable to convert whitespaces...
asked 4 months ago
0 votes
2 replies
How to avoid duplicating routes for user edit page?
I'm making a simple application which have only two kind of users: Admin and SimpleUser. I want my Gemfile to containt as little gems as possible...
asked 4 months ago
1 votes
1 replies
Setting up routes for retrieving subset of records
I have a model that has it's own controller Event, on that model I have a flag that tells me if it's public or not, creating a subset of records....
asked 4 months ago
0 votes
1 replies
Ruby on Rails rendering object with ajax
I am following the book Agile Web Development with Rails 5.1 and am in Chapter 11 where I am trying to create a button that decrements the quanti...
asked 4 months ago
0 votes
0 replies
Is there any way of configuring Spree payment without ActiveMerchant?
I'm trying to implement payment staff in Spree. The staff, named Pay.jp, is like this. - create token from card number and valid date and securit...
asked 4 months ago
2 votes
2 replies
How can I add an auto generated ID to an existing table?
I have a table in my schema that does not have an auto generated ID primary key because I deactivated that option when creating it. Is there a wa...
asked 4 months ago
0 votes
0 replies
Active Storage Provider use case [closed]
I am following this blog to upload image from my react component to active storage https://medium.com/@ebenwoodward/linking-a-react-app-to-rails...
0 votes
2 replies
Ruby - group_by month for current year, including months with no data
I'm trying to write a method to return a very specific data structure for a chart that I am populating. A user can enter dates for miles that th...
asked 4 months ago
0 votes
0 replies
How to configure Jest for Vue app that runs via Webpacker
I've got a Rails app that manages a Vue app through the Webpacker gem. I'm having trouble setting up Jest for unit tests. I've had to add a few...
asked 4 months ago
0 votes
0 replies
Delayed Jobs Added, Not Being Worked Off on Heroku
We are trying to use Delay::Job to process some time specific background functions. While on development things are fine (local machine), the pr...
-2 votes
1 replies
How to find ActiveRecord object that has a unique column values compared to other closeby objects
I have a boolean column called active in a table called user. I'm trying to find users where the user before and after the current_user do not h...
0 votes
0 replies
Most efficient way to create form with multiple nested relationships
Im working on a RPG character sheet (specifically DnD first, but will be universal) and while I got some advice on how to structure my database a...
asked 4 months ago
0 votes
0 replies
Rendering partials to strings in Rails 5
I have a partial as follows: # common/_widget.html.erb <div class="widget"> <%= process_content_tags(variable_with_html) %> </d...
asked 4 months ago