General Ruby on Rails Forum

Calling function from handling click event issue

8
General
Hi Everyone Using the UJS approach Chis showed in the NavBar notifications screencasts, I'm trying to implement something similar, and having very strange issue that I can't even imagine what's th...
Michael Derzhavets replied
Solved

How to I use Refile as Upload in a polymorphic way? I have managed to use it that way but i am struggling on destroy image after uploading

1
General
Here is the Schema for Uploads ```ruby create_table "uploads", force: :cascade do |t| t.string "file" t.string "file_id" t.string "file_filename" t.integer "file_size" ...
Chris Oliver replied
Solved

rails + DB dependent destroy vs cascade delete

3
General
Hi, I wanna make sure that child objects also gets deleted when deleting parent. I'd like to use both `dependent: :destroy` (rails side) and `on_delete: :cascaade` (db side). Is this a good prac...
Chris Oliver replied
Solved

Updating a genre in a nested association

2
General
I've been asking a few question on scraping and nested association. Im running into another issue which is updating genres to each anime. I'm getting a list of genres, for example "Action, Romance,...
Wes replied

How can I solve it?

10
General
Hello guys I have a problem with this! I'm making my website where user can give feedback to my projects, contact me and make comment to a blog_post. The problem is when i make the render 'blog_p...
Federico Calarco replied
Solved

How do I include a placeholder for empty notifications

2
General
Your In-App Notification code worked perfectly. However I'm stuck on what code to use to display a placeholder message if there aren't any notifications. You mentioned this briefly in the episode ...
Stan Smith replied
Solved

Limit CSV export by Day, Week and Month

1
General
Hi there, is there an easy way to limit the results inside a CSV export to a specific time-frame, like day, week and month? Thanks!
Chris Oliver replied
Solved

How do i update an attribute for belongs_to association when scraping a site?

5
General
So pretty much a `anime` belongs_to :season and a `season` has_many :animes. I'm scraping a site and i'm collecting the season like "Spring 2015". I want to be able to assign "Spring 2015" to a ani...
Chris Oliver replied
Solved

refactoring polymorphic actions

0
General
Hi Chris! I implemented the notification system based on your video with the partials. Works perfectly. I've got some problem though when user wanna check out the notification. When he/she clicks ...
Sean M posted

How to by pass a string that has '???????' when scraping for dates and turning the date into an integer?

6
General
I'm scraping a anime information website. Right now, I'm trying to get the date going, but on some of the anime the date comes out as ???,??,????. I'm tying to figure out how to skip that or put so...
Wes replied
Solved

How to build REST APIs?

14
General
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 cr...
Sean M replied

How do I use Let's Encrypt to get and automate SSL on ubuntu, nginx server

7
General
I was thinking maybe this could be a tutorial/guide request? I always use the GoRails guides to setup my ubuntu, nginx, passenger servers(thanks!) I am having trouble figuring out how to use Le...
Chris Oliver replied

data consistency for invitation registration

9
General
Hey! At the moment I have a user and a product table and products are created by users. So the user can create his own product he is working on. User `has_many :products` and `product belongs_to :...
Sean M replied
Solved

Dynamically Defined has_many with odd behavior

4
General
Here's a quirk that's confounding me: Data Model: ```ruby class Athlete < ApplicationRecord has_many :stats end class Stat < ApplicationRecord belongs_to :athlete belongs_to :posit...
Chris Zempel replied

Can I 'alias' a Rails active model to another class

9
General
First off I am sure I am not asking this question correctly as this is an advanced Rails topic over my head right now. Here is what I have for routes: concern :assetable do resources :ass...
Chris Oliver replied
Solved

Save external data in rails db, data structures

0
General
Hello, I need some help/advise on how to save third data in my database, also I'm interested in any tutorial or info about these topic. I'm struggling to save data from third party api. I get the...
Catalin B posted

Opinion: Namespacing Areas of the Application

1
General
I'm working on an application related to a specific sport. A large deal of the value of the application revolves around being able to track different stats by player by position by season. There a...
Ian Gray replied

Error: uninitialized constant HTML::Pipeline::SyntaxHighlightFilter::Pygments when installing html-pipeline

5
General
I am getting an error: `uninitialized constant HTML::Pipeline::SyntaxHighlightFilter::Pygments`. my Gemfile shows: ``` ruby # markdown in comments gem 'html-pipeline', '~> 1.11.0' gem 'github-...
Lauro replied

Dynamic Pricing based on user country

2
General
Hello! I'm thinking of a way to handle dynamic pricing on my web app based on the user country, for example: A user wants to subscribe for a pro account on my website and this user is based outsi...
Enrique Benitez replied
Solved

Opinion: Destroy or not destroy

3
General
I am working on an app and I have already added the paper trail gem (https://github.com/airblade/paper_trail) to track revisions. Now I am thinking that I want to add Paranoia (https://github.com/...
Chris Oliver replied

Learning Ruby on Rails? Join our newsletter.

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