Skip to main content
How return has_many with array instead of object
General Solved • Asked by Bruno Wego
Have a way to a "has_many" return a array instead of object? ```rb class UserSerializer < ActiveModel::Serializer attributes :id, :name, :nickname, :image, :roles has_many :roles en...

What's the best way to install a robust system which checks if an event is over-booked in Rails?
General • Asked by Mike Whitehead
I need to create a system for my Events site that monitors the number of bookings being taken to ensure an Event does not become over-subscribed. What is the most effective (DRY) way to do this? ...

Question on ActionCable Group Chat part 4, development.rb fix for redis
General Solved • Asked by Rob Sturcke
Saw in the comments the fix for ```(REQUEST_METHOD: GET, HTTP_CONNECTION: Upgrade, HTTP_UPGRADE: websocket)``` however I added the following to my ```development.rb```: ``` config.action_cabl...

ActionController::UnknownFormat in MessagesController#create
General Solved • Asked by Rob Sturcke
Ran into this error in part 4 of the ActionCable group chat. What exactly am I missing? Schema looks fine same with MessagesController. ``` ActionController::UnknownFormat in MessagesControll...

How to I access a position attribute on a join model?
General Solved • Asked by Thomas Bush
I have case studies and site models in my database. I have a `has and belongs to many` association set up between them. ## site#show When on a `site#show` page I want to write the following ...

How do I add Ransack in my posts controller?
General • Asked by Brian Gilbank
I am new to rails so this might be an easy question. I am trying to figure out the best way to add ransack to my posts index action. # Ransack @q = Post.ransack(params[:q]) @posts = @q.resul...

Error updating nokogiri and autoprefixer using Capistrano -- local/production gem mismatch
General Solved • Asked by Lance Williams
I've been using Capistrano to deploy my rails app and I've come across an issue trying to update 2 gems. Below at the bottom is the message I get for nokogiri. The other gem I'm trying to update on...

How to build REST APIs?
General • Asked by Ali Ahmed
Hi Chris Yesterday I was just wondering that how can I build an app which follows REST principles. I searched on many articles and they are in too much nitty-gritty with less examples of how to ...

How do I allow viewing of a paranoia soft-deleted show page?
General • Asked by Thomas Bush
I added paranoia gem to my cms application from your soft delete tutorial. I would like users to still be able to access the show page of soft deleted items -- this is where I would add a restore ...

Problems Viewing Videos
Site Feedback • Asked by Frank Vinci
I am having a lot of problems watching the videos here the last couple of weeks. Multiple videos on different laptops and different browsers. The videos freeze constantly and I have to reload the...

macOS sierra working w/ Ruby / Rails / RBENV?
General Solved • Asked by Brian Schwartz
Curious if anyone has tested it? Don't want to upgrade until I know everything in my stack works correctly without a ton of pain. TIA

How to setup SSL with a rails app
General Solved • Asked by Francisco Quinones
So I have a ssl certification that I want to apply to my rails app. Im using puma on Heroku.

User Profile with devise
Gems / Libraries Solved • Asked by Darren Nickerson
Hello I'm new to rails and I am trying to work with the has_one association. I'm using Devise for authentication. I was each user to have a profile (which will include their address and some other ...

How do I read an incoming webhook post in Rails 4.2
General • Asked by Aaron Mills
I have something along the lines of this: case request.request_parameters.keys.first when "new_subscription_notification" when "canceled_subscription_notification" deactivate_subscri...

Which gem is the best for dynamic image resizing from an S3 URL?
General • Asked by Robert White
Hi, Which gem is the best for dynamic image resizing from an S3 URL? I know i can pre define this, but I have hundreds of people using the product with endless uses cases I'd like them to specify ...

Is there a good reason to not use keyword arguments always?
General Solved • Asked by Rutul Dave
I have used keyword arguments for some of my methods before, but haven't really thought about why not use it for all methods with arguments? Seems like there is no good reason to have the calle...

How do i save a field in a separate table?
Rails Solved • Asked by Alan Reid
Hi all, I want to save the brand_id i am creating in my users table how would i go about doing this? I currently have my code saving the brand. ```` def create @brand =

Lazy Load - Guide
Javascript Solved • Asked by Menj Villalobos
Hi, Anyone successfully implemented or integrated "Lazy Load" for their rails app? Can I ask some guide/tutorials please. Thanks :)

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...

Has any installed macOS Sierra yet?
General Solved • Asked by Jordan Godwin
Just curious if anyone is running macOS 10.12 Sierra yet, and if so, how are things with your dev environment? Specifically with Homebrew and such?