474 questions
0 votes
1 answer
230 views
Why can't New Relic display some metrics for a Ruby on Rails action?
I have a Rails action that has 83% of its run time spent on this: ApplicationCode in (Nested/Controller/my_controller/my_action There's an info popup that says this: Deeper visibility is not ...
0 votes
0 answers
76 views
generate routes for all entries in table Rails 4 ruby 2.3
I have a Table called Blog which has 20 entries. Now i want to create 20 routes fetching title from the Blog table with minimal code or method in routes file. And i dont want to create it manually. ...
1 vote
1 answer
1k views
Why does ActiveRecord find_by return nil when using it together with select?
I found the following kind of usage of ActiveRecord#find_by written in a Rails 4.1 project: booking = Booking.find_by(member_id: Member.where(id: 1).select(:id)) However, this query returned nil ...
0 votes
1 answer
252 views
Rails 4.1 route path helper using incorrect id in path generation
I'm working on an upgrade from Rails 4.0.13 to Rails 4.1.16... en route to Rails 5. @account and @facility are ActiveRecord model instances, retrieved successfully in the controller ...
1 vote
2 answers
2k views
Cookie is not set when secure option is enabled in rails session_store configuration?
Below is my code in session_store.rb Rails.application.config.session_store :active_record_store , key: '_test_key', secure: :true Browser receiving below response headers when requests rails ...
1 vote
1 answer
164 views
Dealing with multiple cached Javascript files
I recently pushed a new version of my websites Javascript code, which caused CSS and JS media not to be loaded. In the case of Chrome, the requests were stalled due to a 6 request per domain/origin ...
1 vote
1 answer
971 views
Devise, Capybara - 'UncaughtThrowError (uncaught throw :warden)' possibly due to Timecop
Some of my feature specs are failing intermittently. Our specs are setting the base-line to be in the past. I have found the following: Error thrown is: UncaughtThrowError (uncaught throw :warden): ...
0 votes
0 answers
533 views
Force SSL exception for Rails app
I'm working on a specific case where I want to force SSL in a Rails app, I've tried using: Rails.application.configure do config.force_ssl = true end However, there are a couple of endpoints that ...
0 votes
1 answer
1k views
How to check asset pipeline is working properly without deploying
Is it possible to check that asset pipeline related code and configuration is working without deploying? Deploying to the testing server takes a couple of minutes, which is time I'd rather not waste. ...
0 votes
1 answer
638 views
ImageOptim::BinResolver::Error: Bin resolving errors: remote: pngout worker; using image_optim, image_optim_rails pushing to Heroku
The buildpacks on my environment are as follows === xyz-app Buildpack URLs 1. https://github.com/jasonfb/heroku-buildpack-cedar14-imagemagick704 2. https://github.com/bobbus/image-optim-buildpack 3. ...
2 votes
1 answer
4k views
how to schedule for every 30 seconds with sidekiq-scheduler
I am working on ROR application. i have a functionality requirement, where i have to call a method for every 30 seconds using sidekiq and i am using these gems # sidekiq gem 'sidekiq', '~> 3.3.0'...
0 votes
1 answer
90 views
Datetime handling in rails 4
I have a rails 3 app I've updated to 4.1 and have one failing test left that is driving me crazy. It seems that in rails 4, when you create a datetime with only a date, it adjust the time to the ...
1 vote
1 answer
2k views
Can I Populate / update a new record after using find_or_initialize_by with one line like when using new()?
I am in the process of changing some functionality and as such, I want to use find_or_initialize_by to replace new My modal has 13 columns modal = Modal.new(col1: col1, col2: col2..... col13: col13) ...
0 votes
2 answers
59 views
Routing Issue in Rails 4
I have created a form useing form_for - = form_for @category, url: url_for(:controller => 'admin/category',:action => new_record ? "create" : "update"), name: 'udfFieldForm', id: 'udfFieldForm'...
0 votes
1 answer
436 views
Rails Nested Form(Using Jquery)
I am having three models Deals,CellPhoneAttribute and Cellphone Equipment. The relation between models are: class CellphoneEquipment < ActiveRecord::Base belongs_to :cellphone_deal_attribute ...