All Questions
Tagged with ruby ruby-on-rails-4
12,319
questions
0
votes
2
answers
58
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
36
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
85
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
50
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
78
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
50
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
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
413
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, ...
0
votes
0
answers
21
views
Beanstream::InternalServerException: on rails 4.2 using gem "beanstream"
Hey I am facing this error:
I am using gem "beanstream" have configured the Beanstream initializer as well
Beanstream.profiles_api_key = ENV['beanstream_profiles_api_key']
Beanstream....
0
votes
1
answer
38
views
How to handle the params for accepts_nested_attributes_for for has_many association containing a lot of fields on both associated table
I have user model which has has_many association with building model. Initially I was creating the user and the building seperately by using user.create and user.buildings.create because there were ...
0
votes
2
answers
75
views
How can I prevent n+1 issue from array that is generating additional conditions?
I'm facing n+1 issue when using conditions on array that comes from includes query.
Here are the following tables:
rems
|id| |name|
1 aaa
2 bbb
rem_correlatives
|id| |rem_id| |name| |deleted| |...
0
votes
1
answer
96
views
Rails both way relationship between two tables
In Ruby on Rails I'm trying to be able to create both way many-to-many relationship between two tables. I want a relationship in routes and controllers. For example I want to be able to do both of the ...
0
votes
0
answers
42
views
Getting permission denied error when downloading a html page as html
This is my shortlisted action and shortlisted.html.erb , when clicked on download the list of shortlisted candidates should get downloaded.
def shortlisted
ids= AppliedJob.shortlisted.pluck(:user_id)
...