In this post, we will see how to resolve Unauthorized access error from google bucket while accessing getObject API Question: Since past few days, our system is experiencing one strange issue. We have one ruby application in which has a ...

In this post, we will see how to resolve Could not find generator ‘mongoid:config’. When rails generate mongoid:config Question: I’m new to Ruby on Rails.I’ve been trying generate mongoid.yml file to connect with mongodb. but im getting this error: This ...

In this post, we will see how to resolve Can i use variables in Rails link_to method? Question: Can i use variable for Rails link_to helper for making different link with variables? For example, <%= link_to users, users_path %> I ...

In this post, we will see how to resolve Difference between 2 timestamps(String) in hours in Rails Question: I have one time in a hash as and also i would be taking the current time in the same format using ...

In this post, we will see how to resolve how append an object to association relation in rails? Question: In a rails 4.1 application I need to add an object to an “AssociationRelation” Is there a simple way to do ...

Question: Is there an alternative to update_attributes that does not save the record? So I could do something like: BTW, I know I can @car.model = 'Sierra', but I want to update them all on one line. Best Answer: I ...

Question: I ran into an issue in my Rails 4 app while trying to organize JS files “the rails way”. They were previously scattered across different views. I organized them into separate files and compile them with the assets pipeline. ...

Question: Where can I find a list of data types that can be used in Ruby on Rails 4? Such as text string integer float date I keep learning about new ones and I’d love to have a list I ...

Question: The default Rails 4 project generator now creates the directory “concerns” under controllers and models. I have found some explanations about how to use routing concerns, but nothing about controllers or models. I am pretty sure it has to ...

Question: How do I generate a random number between 0 and n? Best Answer: Use rand(range) From Ruby Random Numbers: If you needed a random integer to simulate a roll of a six-sided die, you’d use: 1 + rand(6). A ...