Chris Oliver

Joined

293,020 Experience
93 Lessons Completed
295 Questions Solved

Activity

Posted in Direct File Uploads to S3: Part 3 Discussion

Hey Hal, good find. I think I noticed it but it was subtle enough with small files I didn't catch it.

The solution should be to delete the existing file field from the FormData object before you append the jquery file upload one.

      var form      = $(this).closest("form");
var form_data = new FormData(form[0]);
form_data.delete($(this).attr("name")); // Remove the existing form field
form_data.append($(this).attr("name"), JSON.stringify(image)); // Add our json version

Posted in Setup MacOS 10.12 Sierra Discussion

There's actually a bug right now (in the last 2 hours) with the thor gem causing problems in new apps. Try this: http://stackoverflow.com/a/...

Hey Masud,

Absolutely. The way it's designed is that you can create a new channel for each feature you want and the ActionCable code internally will automatically separate out the messages for each of those channels. That means you can have one for notifications and one for chat and they will be separated out between those channels.

Posted in Pretty urls with FriendlyID Discussion

Looks like possibly @job is nil? Also happy thanksgiving! :D

ElasticSearch + Searchkick is awesome. I need to get GoRails search swapped over to it very soon!

Posted in Direct File Uploads to S3: Part 3 Discussion

It's the exact same process if you look into what they do. I recommend Shrine because then you can take advantage of all of the features of it after the file is uploaded such as image processing, thumbnails, background processing, you name it.

Posted in Subscriptions with Stripe Discussion

Happens to the best of us. 🤓

Posted in Subscriptions with Stripe Discussion

Hey Liz! :D

I would say, try restarting your Rails app. If you make a change in any of your config files, you generally have to restart your Rails server so it can get the new changes. The rest of the code auto-reloads when you make a change but this stuff does not.

I think you're close, but you want an array of hashes.

Person.search params[:q], {
fields: [{name: :text_start}, {breed: :text_start}],
limit: 10
}

The searchkick docs also show another method, putting the autocomplete types on the searchkick method in the model and just listing out the fields by name. https://github.com/ankane/s...

Posted in Remove omniauth and convert existing users

OAuth definitely gets tricky pretty fast, especially when some services like Twitter don't give you an email, so you can't create User records without asking and so on.

When you try it in the console, try printing out user.errors when the save fails so you can see what the errors were. It could be one of your validations failed and that will let you know what went wrong.

Posted in Need another series on Rails with Angular 2

ABSOLUTELY! :D

Going to cover short introductions to React, Angular, and Vue when I get back from Thanksgiving.

Posted in Upgrading simple_calendar for Rails 5 Discussion

For both recurring events and various types, you just have to make them into one array and pass them in. So rather than calling them @dances, you might use @events and create it like so:

@events = Dance.all + Meeting.all

I just recorded a basic episode on recurring events, but you'd just generate them in memory and add them into this @events array. The calendar doesn't need to know anything about recurring events, just needs the individual events to display.

Posted in Setup Windows 10 Discussion

Hopefully that default changes in Windows as that's unexpected behavior from anyone who is used to opening bash with a login shell automatically on any Linux install.

Posted in Setting Up Rails 4 with MongoDB and Mongoid Discussion

Thanks for sharing all this Matt! Will be useful for anyone reading this as I think it was originally written for Mongoid 4.

It's great to hear that they finally got the ActiveRecord + Mongoid stuff working nicely. I remember it wasn't super doable last time I used it because of some incompatibility.

Yeah, thanks! I know that the react_on_rails gem actually uses webpack for compilation but uses the asset pipeline for the embedding into Rails which is nice. I'll have to dive into these articles soon and start planning a webpack episode.

Posted in Direct Messages in Realtime with ActionCable Discussion

Just like we did in this episode, you create direct messages between two users by using them in the pubsub channel name. Nothing different there.

For the popup UI, add data attributes to the link so when it's clicked you can find the User ID of the person you want to direct message. Then you have both the current user, and the recipient ID which you can use to start the pubsub channel between the two people.

Posted in Direct Messages in Realtime with ActionCable Discussion

Absolutely. You can create any UI you want for this. My example is more like Slack, but you can do the same thing and use the button to initialize displaying a popup chat box instead.

Posted in Inviting Users with devise_invitable Discussion

Thanks for sharing Anthony! I'm sure people will find that useful. :)

Yeah, I'm gonna talk about Webpack in the future when we get into the frontend framework stuff. It's one of those things that I'm disappointed Rails hasn't improved the asset pipeline enough speed wise, because it doesn't feel like the most useful use of your time to be fiddling with WebPack configurations.

I still very much appreciate the convention over configuration approach Rails takes, just need to get some speed boosts in there and things would be great.