I am creating applications where the menu structure is kept in a SQL database. Each user has a different menu depending on their permissions. The menu ...
I am creating applications where the menu structure is kept in a SQL database. Each user has a different menu depending on their permissions. The menu ...
What is the difference between next if vs next unless. My understanding of next if was that next only if variable == value but in the following code, ...
I have method common method def error_notification <notification_code> end whenever the code catches an exception I need to call this met ...
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 is my Gemfile I tri ...
I have a below string array object which has 4 elements. I want to compare the elements of this list to an string and want to check if string is part ...
I have two FactoryBots => user and post And post has user_id column I want to make 10 users, and 100 posts (10posts per each user) so i tried ...
Can i use variable for Rails link_to helper for making different link with variables? For example, <%= link_to users, users_path %> I have lin ...
Hi i'm freshman to Ruby on Rails. I'm trying to make current_user method and i have a question. Many Rails courses make current_user method like this. ...
assuming i have two models human and male, they both have similar attributes but not all the attributes, for example: now what i want to do is when ...
I am trying to get data that is grouped by :user_id for bar charts. I want to organize it in descending order. Howe can I do it? In addition to i ...
I have installed the Bullet gem for rails to try and clear out some of my N+1 queries, however I can't get the gem to work. First I added the gem to ...
I was writing a backend program with rails + mysql, trying to retrive a "date" type column to my frontend. basically The "date_agreed" and "date_ag ...
The error is as follows and I cannot figure out how to fix it - any more experienced people know what I am doing wrong? ...
I have a requirement in ruby where I want to fetch all the data present in database for the current month. However, there is a catch. I wanted to fetc ...
I have a table(Users). In one of its columns(configs) i added a default value ("A"=>0) through a migration. Now all the new users i create have def ...
I have created project in path: D:\Сайты\ruby\lr5. When I am trying to launch it by command rails server it throws this error: I was trying to unin ...
I make objects in controller's loop. I need to check pet_name array before loop starts. (because i got undefined method 'each' for nil:NilClass when ...
I am trying to use jstree in my ruby on rails application. I have the following data captured in rails TransferRequestController.rb In my applicati ...
I have a time like "estimatedTime": "2022-11-09T22:59:00Z" as json, which is parsed into datetime and saved in the db (t.datetime "estimated_ti ...
When I run bundle exec rspec, I only get reports of failing tests, but no standard output (from something like puts, unlike in this question). I do n ...