Chris Oliver

Joined

296,240 Experience
100 Lessons Completed
295 Questions Solved

Activity

Posted in Few Big Models or Many Smaller Namspaced models?

Hey Rich,

The best advice for these types of questions will always depend upon what you want to do in the future with your app. Will you be treating Facebook, Google, etc reviews as mostly the same thing? Sure, you'll need to know the site and page the review was on, but will you have specific integrations with each site?

If they will stay mostly similar, then I'd keep it as a single model and just store the site like "google" "facebook" etc as a column and the url for the page. Then if you ever do need to add some more specific things you can just say "okay this is a google review, let's create a Google API client and sync any changes".

If you plan on having different functionality for each review type, then separate models make more sense. You can then add functionality that's unique to each site (maybe they have a lot of different attributes you want to store).

So it'll depend upon what you want to do going forward. You probably know that best since you're designing the product which means you'll probably have a better idea of which one will be most fitting with your product. 
Hey TL,

You're looking for the backup gem's Syncers concept: http://backup.github.io/backup/v4/syncers/

You can't use rsync with S3, but you can use this gem's S3 syncer to mirror all the files on disk with S3.

The S3 Syncer just takes some directories that you want to sync and will handle all the uploads. http://backup.github.io/backup/v4/syncer-s3/
All the code for this the feature is in https://github.com/excid3/jumpstart

You'll want to grab:
1. Database column on User for last read announcements timestamp
2. Announcements model
3. Announcements routes, controller, and views
4. The navbar code to highlight the What's New link when there is are unread announcements for the user.

Posted in Where to get started?

It's either on the dashboard (click the logo in the navbar) as the 3rd step in the Welcome section, or on your account profile here: https://gorails.com/users/edit

Posted in Where to get started?

Don't forget to join us in Slack if you want to hang out and chat with us!

Posted in Where to get started?

Hey Justin!

I would probably recommend starting at the very first episodes. I covered a lot of the things you'll do in every app at the beginning and then started branching out to more features as time went on.

Posted in how do i resolve this error?

Hey Alan! 

Change your "book_params" method at the bottom of the controller to "recipe_params" and you should be good. Looks like just a copy-paste typo you missed. 🤓
Hey Jeff,

You want to either use the local_time gem to handle this client side or simply set the Time.zone to the user's timezone for every request. 

For the second option, you have to save the timezone on their database record so you can retrieve it and set it every time. 

local_time's a lot simpler as it just checks the browser's timezone and converts all the times using JS.

Posted in Deploy Ubuntu 18.04 Bionic Beaver Discussion

Thanks btihen! I'll get the tutorial updated for its changes shortly!

Posted in How to render ssh output

I'm moving this weekend, but I'll try and make an episode on this next week along with my continuation of the SOLID series!

Posted in How to render ssh output

Hey Quentin, I haven't covered it anywhere but I'd be happy to. Are you wanting to stream SSH output too or something similar?
Not sure, but you might check the git repo. I updated it to Rails 5.1 and Ruby 2.5 recently. Rails 5.2 shouldn't cause any differences but the webpacker gem does change frequently.
I didn't cover it. Early screencasting mistake. You can follow this episode to install Bootstrap. https://gorails.com/episodes/bootstrap-4-rubygem

Posted in Update an attribute on belongs_to

Hey Alan,

You kind of have two options:

1. Having nested fields for the product_groups. Primarily this would be just letting you add / remove these and then have a select box to choose which group. The gem cocoon would be good for this.
2. Having nested fields for the groups. This skips the product_group and the join association would be automatically created for you. This you could use checkboxes or a multi-select, but it wouldn't let you define other fields on the join table (if you needed to do that). It is a lot simpler though.

Posted in How do I generate dynamic classes?

Posted in Rails Application Templates Discussion

Hey Josh,

Administrate gem just needed updating. Should be fixed now!
I've been using Redis for Rails cache + Sidekiq for years now. Absolutely no problems. There's probably some rare situation that could cause trouble, but I prefer the simplicity of managing less services in production and it's worked just fine.

Posted in Form errors not displaying

No problemo! It's one of those subtleties of Rails that you have to learn the frustrating / hard way. 😜

Posted in Form errors not displaying

Hey RJ!

When you redirect, none of the variables are persisted over because you're making a totally new request. You must `render action: :edit` in the else clause in order to render the errors on the model.