Skip to main content
Gravatar
Any gem to create a 'What's new' page like the one I see in https://www.hatchbox.io/announcements
Gems / Libraries Solved • Asked by TL
Do you guys know any gems to quickly build a 'Whats new' page like the one in https://www.hatchbox.io/announcements?

Gravatar
Whats the best way to handle errors, when creating new records?
Ruby Solved • Asked by Alan Reid
Hi all,I am creating new records, and want to be able to catch the ones that error and add them to my activity log so I can look into them and why they may have failed.What would be the best way to...

Gravatar
How do I transfer user data on delete
Rails Solved • Asked by Stephen Sizer
I have a rails app with company users using devise. I want to be able to delete users and select an employee to transfer the foreign keys to.Hope that makes sense? Thanks in advance

Gravatar
How to count comments like reddit (infinite nested model) ?
Ruby Solved • Asked by Robert Hopman
Hey Chris, I have an `item` model which gets submitted. With `has_many :comments, as: :commentable, dependent: :destroy` then in the `comment` model I have `belongs_to :commentable, pol...

Gravatar
How do I make my Stripe Charges more robust [Background Worker & Idempotent]?
Rails Solved • Asked by Taylor Cooney
One thing I don't want to have to deal with are refunds because a customer happened to get charged twice. I want to ensure that I've designed my Rails app to be robust in the face of failure before...

Gravatar
how do i resolve this error?
Ruby Solved • Asked by Alan Morley
undefined local variable or method `recipe_params' for #<RecipesController:0x00007ffa3c046490> Did you mean? recipe_path def create @recipe = Recipe.new(recipe_params) if @rec...

Gravatar
SQL for search
General Solved • Asked by Robert Hopman
Hi Chris,I had a question, solved it, now I'm looking for your feedback. For readability I use `a` in the example below:a = params[:query] Item.where("name ILIKE ? OR tagline ILIKE ? OR details IL...

Gravatar
Update an attribute on belongs_to
Rails Solved • Asked by Alan Reid
Hi all,I have my products and groups set up like so...class Product < ApplicationRecord has_many :product_groups has_many :groups, through: :product_groups endclass Group < Application...

Gravatar
How do I build a beta invite system?
Gems / Libraries Solved • Asked by Rafid Hoda
Hi! I'm getting ready to release a beta for my rails app and I was wondering if there is an easy way(perhaps a gem?) to build an invite system, so that only users that receive an invite through ema...

Gravatar
local_time gem: Where to place the I18n file to modify the string literals?
Rails Solved • Asked by Ernesto Gimeno
EDIT. Finally solved, I pasted the keys from I18n.coffee into application.js like that:LocalTime.config.i18n["es"] = { date: { dayNames: [ "Domingo", "Lunes", ...

Gravatar
How do I charge a user to create a post using Stripe?
Rails Solved • Asked by Taylor Cooney
It's been surprisingly difficult to find more information on creating one-off, or single charges for a user.Currently I am making a job board where anyone can browse listings, and a user (Devise) h...

Gravatar
Form errors not displaying
Rails Solved • Asked by RJ McCollam
In my model for users I am validating the presence of a number of attributes using:validates_presence_of :parent_1_first_name, :parent_1_last_name...The beginning of my form object looks like this:...

Gravatar
Check if class was instantiated and instance method was called
Testing Solved • Asked by Alex Musayev
Hey guys! I'd like to figure out a way to test piece of code that suppose to create an instance of particular class. Here is an example: ``` ruby class Subject def call ... end end ...

Gravatar
Running multiple Rails versions
Rails Solved • Asked by Jiri Prochazka
Hi guys (and ladies if any), I have installed Rails with rbenv (recommended), but now because of significant changes between 5.0.1 and 5.1 versions, I want to start a new project with 5.1 (becau...

Gravatar
How do I display related or similar Ads by currency on the Ad show page?
Rails Solved • Asked by Charlie Kay
Hi Chris I need your help on this please.  I'm trying to display related Ads on the Ad show page by currency. But somehow  my script displays the same Ad in multiples of related Ads and not showing...

Gravatar
rendering issue
Rails Solved • Asked by Matthew J Martin
OK, so I fairly new at rails, but i'm at the point where i feel confidence enough to start making my own side project which i decide would be a clone of facebook in rails. first i'm working on is g...

Gravatar
Using find_or_create_by with accepts_nested_attributes_for
Rails Solved • Asked by Nino Rosella
Hi gang...I have a Book which has_many :authors, through: :book_authorsInstead of creating a new Author each time I create a book I'd like to use find_or_create_by on the author's name attribute. R...

Gravatar
Render partial via AJAX without JQuery
Javascript Solved • Asked by Ryan Martin
I've got a standard Comment.model - I'm trying to use AJAX to render partial. Using JQuery works but I'm trying to use VanillaJS only. The AJAX is working but it's rendering the markup inside of th...

Gravatar
Why do you choose ams (active model serializer) over jbuilder or the other way around? (Rails API)
Gems / Libraries Solved • Asked by Drilon Buzuku
Hey Guys, I'm interested in knowing, why some developers choose ams over jbuilder and some prefer jbuilder over ams, to build Rails based API's. Cheers, Drilon

Gravatar
Having a little problem running the 'rails server' command...
Rails Solved • Asked by Codesaurus1
Hi there,I'm new to the whole programming and I'm trying to figure out why I can't seem to run the 'rails server' command if anyone can help me out that would be cool. The code below is what I get ...