Save 36% for Black Friday! Learn more

Ruby on Rails Community Forum

Need some help with an Active Record Query

6
Rails
HiI have these tables:Users which has many:Farms which has many:StoresI want to return stores that belong to a specific user_id.Got this far but Rails is giving me an error.Thanks in advance for an...
Simon P replied
Solved

s3 images not showing up in gmail?

2
Rails
So I'm sending an email using actionmailer which has an image-tag for an image that is stored out in S3.  For some reason gmail doesn't display the image.  it displays images that...
Jason Ormes replied
Solved

ActionCable streaming from a strange channel name

1
Rails
Hello!I'm following your course "Group Chat with ActionCable" and everything works fine, except one thing: When I broadcast to ActionCable.server.broadcast "rooms:#{mes...
ValentinKLN replied
Solved

Form item disappearing when failing nested validations

4
Rails
I have a Rails 5 app, and I'm having a problem with validations using the Cocoon gem with nested, dynamic forms. When a validation on my Book model fails, and my create action renders :new...
Nino Rosella replied
Solved

Issue with multiple URL's on an Ubuntu/Apache2/Passenger machine

1
Servers
I have a linux machine that I put together within my organization for Rails applications. I have my first site all set up and working. I am now trying to add a second site/URL to the box and for so...
spacerobotTR replied
Solved

Few Big Models or Many Smaller Namspaced models?

6
Rails
Anyone able to give suggestions on model design? I'm building an app to help small businesses get more reviews across the web. Concept is simple, user registers a business, and their businesses...
Rich Smith replied
Solved

Any gem to create a 'What's new' page like the one I see in https://www.hatchbox.io/announcements

2
Gems / Libraries
Do you guys know any gems to quickly build a 'Whats new' page like the one in https://www.hatchbox.io/announcements?
TL replied
Solved

Whats the best way to handle errors, when creating new records?

6
Ruby
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...
Alan Reid replied
Solved

How do I transfer user data on delete

5
Rails
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
William Kennedy replied
Solved

how do i resolve this error?

2
Ruby
undefined local variable or method `recipe_params' for #<RecipesController:0x00007ffa3c046490> Did you mean? recipe_path def create @recipe = Recipe.new(recipe_params) if @re...
Alan Morley replied
Solved

Update an attribute on belongs_to

3
Rails
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 < ApplicationRec...
Alan Reid replied
Solved

Form errors not displaying

3
Rails
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:...
Chris Oliver replied
Solved

SQL for search

2
General
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 de...
Joe Guerra replied
Solved

Should Categories be it's own resource or model attribute?

4
Databases
Hey guys, I have a question on database design. Say I have a Post model that has/belongs to a category (out of about 20 categories or so). I am thinking of two options that have their own meri...
Ariff Munshi replied
Solved

Having a little problem running the 'rails server' command...

0
Rails
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 ...
Codesaurus1 posted
Solved

How do I ajax query (select) on a huge number of records (zipcodes)?

4
Javascript
Spaces-are-not-working-in-wysiwyg-editor-but-the-question-from-above.
Brandon Buteaux replied
Solved

How do I charge a user to create a post using Stripe?

3
Rails
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 (Devis...
Taylor Cooney replied
Solved

Best Method For User's Dashboard?

1
Rails
Hi, I am looking for advice on the best way to organize a dashboard to show the user various information from across different models. I was considering just generating a DasboardsController, ...
Kevin Vanzandberghe replied
Solved

How do I put a live time(seconds) counter on a page?

1
Javascript
As in it should go 00:00 .. 00:05.. 00.49 ..15:55 to whatever. Wondering how to do this on the front-end.Should I just use jquery? Or something else? Any suggestions?ThanksArjun
William Kennedy replied
Solved

How do I send send a erb template as a string in a json response?

1
Rails
I have a page editor that shows the user a live preview of their changes as they make them, but I’m having trouble working out how to do this with erb templates.In my previous non rails version, I ...
Jacob Montgomery replied
Solved

Learning Ruby on Rails? Join our newsletter.

We won't send you spam. Unsubscribe at any time.