Activity
Hey thanks! I did the whole thing together and just split up the video for consumption's sake and just posting one a day this week. I think I noticed that about halfway through that the tutorial didn't mention everything, so I started referencing the Github repo. :) I'm going to add that in the notes so people can check that out easily as well.
Had a lot of fun going through your tutorial. That was my first time checking out RethinkDB and I like it quite a lot. Please post some more! :D
jquery_ujs is used to trigger that. If you've got method post, then you'll want to see if you have JS errors that are causing it not to run that code to intercept the click and submit a POST instead.
Aside from that, I'm not sure. You might clone the repository and see if that works for you and compare your code with it. Probably something small, but super hard to debug over comments. :)
Posted in Problems Viewing Videos
Possibly, but I bet you probably aren't the only one. Can you try it in another browser? I'm wondering if these are stemming from changes YT and Wistia are doing internally? I know that Wistia pushed everyone to their new platform because Chrome 53 kills Flash support.
I know right?! :)
Posted in User create Dynamic Role base
Check out Rolify. It can handle pretty much anything you want to do with roles and permissions.
Awesome! check out collection_select
for that dropdown btw. :)
Hmm, welp, there's something definitely wrong then. I did notice your Brand model was missing the through association on this: has_many :users, through: :user_brands
. Possibly that's it? I didn't think that was required, but maybe...
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.
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
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?
Did you create your UserBrand model? or did you name it like I showed as BrandUser?
Haha you know I think we might have! Never hurts to talk about it again though. :)
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?
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:
- Take this and run it in your rails console:
Post.search(params[:term], fields: [{title: :text_start}], limit: 10).map(&:title)
- 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.
- 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. - 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. :)