Chris Oliver

Joined

290,710 Experience
86 Lessons Completed
298 Questions Solved

Activity

Posted in How do i save a field in a separate table?

Hmm, that shouldn't be possible because of creating it through the association. Print out the brand before the save or byebug it to inspect and make sure it has the association setup in memory and the @brand.user_brands record as well.

Posted in How do i save a field in a separate table?

That looks correct. Everything working now?

Posted in Problems Viewing Videos

Thanks for the heads up Thomas. I wonder if this is a buffering issue or something.

The YouTube ones have always autoplayed just fine for me and testing just now it happily goes past the 42 second mark. However, the Wistia ones were getting stuck at 3 seconds before and seem to be loading fine for me now as well.

I also just tested this in Safari, Firefox, and Chrome and the YT videos autoplayed correctly past 50 seconds and more.

I'm curious, does this also pause at the 42 second mark for you? https://youtu.be/7B4wG7e9ayw?autoplay=1

Posted in Group Chat with ActionCable: Part 4 Discussion

Hey Brice, you might check your code because the Join button I believe needs to submit a POST request and your error is looking for the show action which implies it sent a GET request instead. The Join button should create a POST request in order to create the record to set you as a user inside the channel, so it should take you to the ChatroomUsersController's create with that POST. Make sure that link has a "method: :post" option on it?

Posted in How do i save a field in a separate table?

Did you create your UserBrand model? or did you name it like I showed as BrandUser?

Posted in How do i save a field in a separate table?

Haha you know I think we might have! Never hurts to talk about it again though. :)

Posted in How do i save a field in a separate table?

Yep, if every user needs multiple brands, you'll need a BrandUser model (or UserBrand, whichever is clearer) in order to do that.

Then if you've got your associations setup, you can change your first line to the following which will automatically create the join record for you.

@brand = current_user.brands.new(brand_params)

That will require you to have these associations:

class User
  has_many :brand_users
  has_many :brands, through: :brand_users
end

class Brand
  has_many :brand_users
  has_many :users
end

class BrandUser
  belongs_to :brand
  belongs_to :user
end

This one is a pretty fun project too. :D

Posted in File Uploads with Refile Discussion

I don't use this anymore, but I would recommend just following the readme for the S3 example they have: https://github.com/refile/r...

Their Github would also be the best place to ask for questions on S3 as well.

Awesome, I just ran into a thing that I need to have SSL for a side project last night so I'm going to try using Let's Encrypt to get that setup. Can't wait to try it out!

Hey Mark,

Yeah, so I think the one thing with multitenancy is that the goal is to truly separate out all your data between users so they never intermingle. Most people don't actually want or need that, but some do for security reasons. Sounds like in your case you don't really need it.

I'm not sure of a better way of structuring this for you because regardless you're going to be stuck within the tenant. What if you don't use tenants and instead make sure that you scope all your queries to the current user or organization?

Posted in Group Chat with ActionCable: Part 4 Discussion

The authenticity_token: true thing makes me think the same. I haven't ever had to do that, but maybe something has changed more recently that I don't know about. Always possible!

Hey Kosta,

I'm not sure entirely what's wrong, but here's what I would do:

  1. Take this and run it in your rails console: Post.search(params[:term], fields: [{title: :text_start}], limit: 10).map(&:title)
  2. If this doesn't return an array of string like the test example, then you know this is the problem and you can start fiddling with that to get it to return the right format. Maybe you just needed to reindex or something simple.
  3. If it does return an array of strings, then go into your browser and check that the JSON it receives is correct. You can print it out in the browser with a console.log to verify that.
  4. If you are receiving the correct JSON in the browser, then you can check to make sure this gets passed over to the autocomplete correctly. You know this probably isn't the case because the test JSON did work, so it's the least likely to be the problem.

That should help you break apart the problem to figure out what's the piece causing the problem and it'll probably be obvious once you get there. :)

You save the customer to an instance variable in the initializer so that you can save it around and use it in any of your subclasses automatically. They don't have to worry about how they get the customer, they just know they have it so they can implement only the calculation.

Posted in Group Chat with ActionCable: Part 4 Discussion

You might continue on a bit, I ended up refactoring this to use ActionCable to send messages over instead of an AJAX form because you might as well be using it two ways.

I'm not sure what's up with your authentication token, but it does sound like your server side is looking for an HTML response, not a JS response, even though if it was an AJAX request, it should. Sounds like something's not quite right with that somehow. I'm not entirely sure off the top of my head though.

Posted in Group Chat with ActionCable: Part 7 Discussion

Hey Nikola, looks like you don't have a @chatroom_user record set. That was one of the things we discovered was missing, so you'll want to make sure that your user's got that record when they join. We made a couple tweaks to this to fix a couple bugs on Github, so you might want to check those out: https://github.com/gorails-...

Posted in Has any installed macOS Sierra yet?

Let me know how it goes! I was considering upgrading to the GM too, but I'm a little afraid to just because I don't have a backup computer to use in case something goes wrong. :)

Posted in Has any installed macOS Sierra yet?

I haven't yet, but I know that people were using my guide on Sierra really early on. Xcode and homebrew got updated rather fast this time and while I'm sure there are still some issues with it, it sounds like it's working pretty smoothly for everyone.

Here's some packages that aren't currently compatible with Sierra: https://github.com/Homebrew/homebrew-core/issues/1957

Probably some other Github issues you could find on compatibility stuff, but as far as I've heard I think you'd be safe to upgrade.

I realize I'm about a month late on replying to this thread, but I'm definitely going to add this to the guides.

It looks like the renew goes into the public folder in your app. Does this mean that if you do a new deploy with Capistrano it loses access to that file if you ever rebooted nginx or are you symlinking the directory that Let's Encrypt creates on your deploys?

Glad you love it and we're happy to have you as part of the community! :D