Questions tagged [ruby-on-rails-4]
For issues specific to version 4 of Rails. If your question applies to Ruby on Rails in general, use the tag [ruby-on-rails].
ruby-on-rails-4
36,763
questions
0
votes
0
answers
20
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
0
answers
9
views
how to pass object to _blob.html.erb
I use Action Text and Action Storage. Rails make _blob.html.erb file:
`
`<figure class="attachment attachment--<%= blob.representable? ? "preview" : "file" %> ...
0
votes
2
answers
57
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
33
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
70
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
84
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
49
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
77
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
95
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
49
views
HTML to pdf conversion using wickedpdf with page count
I have html that i need to convert it to pdf using wickedpdf gem and
within html I have div
<div class="inner-section" style="page-break-after: always; padding-top: 40px;">
...
0
votes
0
answers
21
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 ...
0
votes
0
answers
26
views
ruby-kafka idle timeout handler to call deliver_messages
Is there a way in ruby-kafka to call deliver_messages on the producer after a certain producer idle timeout? I delivering messages when the buffer_size > n. I would like to clear the buffer if ...
1
vote
0
answers
94
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
65
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 ...
1
vote
2
answers
401
views
Ruby Version Manager
I'm new to Ruby and currently using Windows 10. I'm facing difficulty installing RVM. Since I work on different projects with varying Ruby versions, I want to use RVM to manage them easily. Currently, ...