For issues specific to the minor release of version 4.2.1 of Rails. If your question applies to Ruby on Rails in general, use the tag [ruby-on-rails]
Questions tagged [rails-4-2-1]
47 questions
                    
                    11
                    
            votes
                
                1 answer
            
        Singleton can't be dumped - cached_resource gem
Using cached_resource gem for caching active resources. 
User model
class User < ActiveResource::Base
  cached_resource
  class teachers < SimpleDelegator
    attr_accessor :teacher_id
    def initialize(attributes = {}, _persisted = true)
     …
         
    
    
        Pardeep Dhingra
        
- 3,916
- 7
- 30
- 56
                    11
                    
            votes
                
                1 answer
            
        found unpermitted parameters: utf8, authenticity_token only for update method
I have the update method in user managements controller like this
def update
  @user.update(user_permitted_params)
  redirect_to admin_user_managements_path
end
My strong parameters is set as 
def user_permitted_params
 …
         
    
    
        kurian mathew
        
- 111
- 1
- 3
                    9
                    
            votes
                
                4 answers
            
        Cloning a relation in rails
I'm getting deprecation errors on an upgrade to rails 4.2.1, Modifying already cached Relation. The cache will be reset. Use a cloned Relation to prevent this warning.
The action I'm trying to run gets number of users by month who have logged in.
My…
         
    
    
        Yule
        
- 9,668
- 3
- 51
- 72
                    7
                    
            votes
                
                1 answer
            
        rails 4 When is "inverse_of" required?
I am developing a web app using rails 4 for the first time. I am making all of my model associations bidirectional and using inverse_of wherever it is allowed. 
From reading the documentation, I've developed the impression that this is probably the…
         
    
    
        Nested Software
        
- 303
- 4
- 15
                    6
                    
            votes
                
                2 answers
            
        Upgrading Rails 3.2 to Rails 4.2 getting 401 unauthorized
When I updating to  from rails 3.2 to rails 4.2 the gems are all compatible for rails 4 was cross checked with this 
when I run server it will throwing error as below.
    Processing by HomeController#index as HTML
Completed 500 Internal Server…
         
    
    
        Jagdish Barabari
        
- 2,673
- 3
- 20
- 21
                    6
                    
            votes
                
                1 answer
            
        How do I query with JSON function/operator where key is either not null or is null?
I am looking for the active record version of the following sql code:
select *
from users
where (details->'email') is not null
Let's say that my User model has a json field called, details, and some records will have an email key-value and some…
         
    
    
        robskrob
        
- 2,720
- 4
- 31
- 58
                    4
                    
            votes
                
                2 answers
            
        Debug Levels Rails - The level ":debug" show all logs. I want ONLY ERRORS. Is it possible?
I have an app in AWS Ec2 and I want to see the errors ( 500, 502, 50x, 403, 404 etc. ) ina  log file.
The file config / environments / production.rb
Have the code:
config.log_level = :debug
I tried to change this to :warn, :info, :error,…
         
    
    
        Diego Somar
        
- 941
- 1
- 11
- 28
                    4
                    
            votes
                
                1 answer
            
        Show all authorizations by registers
I have this problem:
I have a controller:
  def index
    if params[:search_employee_by_cpf].present?
      @employees = Employee.search_cpf(params[:search_employee_by_cpf]).all
      @authorizations =…
         
    
    
        Elton Santos
        
- 571
- 6
- 32
                    4
                    
            votes
                
                2 answers
            
        Can we breakdown a large mini-test file (some_controller_test.rb) into multiple test files
I have a controller named reports in my rails applications. This controller have 4 or 5 (reports) actions and not a very large file. 
I am using mini-test for testing my application. The test file of this controller
(reports_controller_test.rb) is…
         
    
    
        wasipeer
        
- 1,015
- 11
- 23
                    4
                    
            votes
                
                1 answer
            
        Using devise_token_auth with form auth
I'm trying to allow using on mobile devices to be authenticated using a token, while still using the webforms for the web application. I decided to use devise_token_auth. Whenever I try and start the application I get an error because a session path…
         
    
    
        Antarr Byrd
        
- 24,863
- 33
- 100
- 188
                    3
                    
            votes
                
                2 answers
            
        PG::ConnectionBad upgrade to Yosemite and postgresql 9.4.4
I just updated my mac OS X to Yosemite, version 10.10.4, and postgresql to: psql (PostgreSQL) 9.4.4.
After running rake db:migrate on my Rails 4.2.1 application, my terminal session is responding with:
rake aborted!
PG::ConnectionBad: could not…
         
    
    
        robskrob
        
- 2,720
- 4
- 31
- 58
                    2
                    
            votes
                
                1 answer
            
        Database.yml - setting up environment groups
Using ruby 2.5, rails 4.2.11,
I'm setting up a dev environment for a ruby project that used to just send straight to production.
HotWire contains application specific data while QualityDC contains much of the relational information shared by the…
         
    
    
        Harry Tasker
        
- 41
- 5
                    2
                    
            votes
                
                1 answer
            
        How to mock file to test file upload in rails 4.2.1
I'm trying to test the action to import products from a CSV. 
I'm being able to get the first test to pass. The params[:file] goes to the controller as a string "#" which doesn't make my test fail but it isn't the correct… 
         
    
    
        waldyr.ar
        
- 14,424
- 6
- 33
- 64
                    2
                    
            votes
                
                2 answers
            
        How to insert data in product table with user id rails 4
Hello I am absolute newbie in rails. creating some application but stuck on some point.  
The problem is I want to insert data in products as per user id but it is saying: 
uninitialized constant ProductController
Here is my route…
        user5084534
                    2
                    
            votes
                
                1 answer
            
        Rails 4: turbo-links change mouse cursor when loading
when using rails 4 turbo-links,
how do you change the mouse cursor to progress when a link is clicked?
i have tried this with no success:
application.js.erb
$(function() {
    $(window).ajaxStart(function() {
       $(this).css({'cursor' :…
         
    
    
        amitben
        
- 670
- 10
- 21