36,684 questions
1 vote
0 answers
43 views
Mobility in the Ruby in Rails app with a non-ActiveRecord model
I'm trying to use Mobility in the Ruby in Rails app with a non-ActiveRecord model by defining a custom backend following the example mentioned here. However, despite specifying the backend in the ...
0 votes
0 answers
44 views
How to do I solve the following Assets Precompile error? [duplicate]
I am creating a ruby on rails project but my javascript files are not loading prperly.Running rails assets:clobber and then rails assets:precopile gives following error. $ postcss ./app/assets/builds/...
0 votes
0 answers
70 views
Rails autoloader is making private constants public
I'm trying to enforce a boundary in a Rails app: only code within the namespace Boundary should be able to access the class Boundary::Blackbox. This works alright when it's defined outside of an ...
0 votes
0 answers
75 views
Devise gem bundled but server indicating error
I am a newbie and would need some assistance. I added devise gem to my Instagram clone app and added "sign up", sign in", "sign out", and "edit profile" links onto ...
0 votes
0 answers
62 views
JSON serialization with a group by query ... how to?
I have an API endpoint to pull a big JSON blob from one of my models, and it works, but I'd like to improve it. The current implementation is below, and mostly just works using built in associations. ...
0 votes
2 answers
160 views
Rspec not able to trigger method inside after_commit callback
I am working on writing a test case for a model Benefit. The class file contains an after_commit callback which calls a method update_contract. It also has belongs_to :contract, touch: true. @contract ...
0 votes
1 answer
90 views
Error when sending invitation with Devise_invitable
I know there's some threads about this but, from what I saw they are quite old and can probably be outdated. I'm using devise and devise_invitable. The idea behind it is to allow admins and teachers ...
0 votes
1 answer
100 views
Getting Error - ActionController::UnknownFormat in MembersController#edit_description
Input Image I'm encountering a "406 Not Acceptable" error in my Stimulus controller's fetch request. The controller is responsible for making an AJAX call to an endpoint, but it seems the ...
0 votes
1 answer
97 views
What each_with_object does in ruby
What each_with_object does? Where it get opts? https://github.com/bodrovis/lokalise_manager/blob/master/lib%2Flokalise_manager%2Ftask_definitions%2Fbase.rb#L23 primary_opts = global_config ...
0 votes
0 answers
143 views
How to fix error in model with gem lockbox
I am using ruby '2.5.9' and rails '4.2.11.3'. I configured all needed things for this gem. I have db with column "password_ciphertext", In model: "has_encrypted :password". When I ...
0 votes
1 answer
144 views
POST data then navigate to a new page and persist said data in Rails, without using the database?
I'm aware POST requests aren't meant for navigation but I just want to check if what I've been tasked with is possible. I have a page in my Rails app - let's call it cars#index. I'm required to make ...
1 vote
2 answers
134 views
is there a way to write this clean?
So i have a flag to disable and enable a feature. and will based on the variable it has to toggle the flags flag_a, flag_b, are my two feature flags and the variable input string can be none, all,...
0 votes
0 answers
36 views
Can we view PostgreSQL tables in django admin or in rails admin, I saw one day my QA colleague viewing tables from rails admin, was that SQL tables?
Just a question, I am Front-end Developer, newbie Backend I saw one day my QA colleague viewing tables from rails admin which was deployed for Backend Testing. So was that MySQL tables, can't we do ...
1 vote
0 answers
221 views
I do not know why I get the following error:uninitialized constant Games Object.const_get(camel_cased_word) ^
I work on a Rails project and I seem to have a route or controller problem which I do not understand. This is the error I receive: uninitialized constant Games Object.const_get(camel_cased_word) ^^^^^^...
0 votes
0 answers
74 views
Execute a ruby script in scala or convert logic in scala
I have a very small ruby script that I need to run in scala either by straightway running the sript which according to resources online is possible through org.jruby but the dependency doesn't work ...