James Ferguson

Joined

1,710 Experience
16 Lessons Completed
0 Questions Solved

Activity

Posted in Liking Posts Discussion

Hi Chris,

I've got this working well without ajax, but as soon as I add 'remote: true' I get a 404 error in the console. The button is pressed, but doesn't update.

Any ideas as to why this is?

Awesome. Thanks for the in-depth response Chris. Really appreciate it.

I'll have a go at it tonight.

Cheers,
James

Hi Chris,

I'm interested in implementing a feature similar to Youtube's watched feature. Where after you've watched a video, a small semi transparent overlay is placed over the video thumbnail with the words "watched".

I've implemented something of my own, but it not very efficient. Each video on the page needs to be looked up to see if the member has watched it. Each response takes 0.4ms times n, where n is the number of videos on the page. So the page load might be more than 6-7 seconds (15 videos on the index page).

How would you suggest I do something like this, so I could achieve the same functionality but with less database requests?

Thanks, James

Posted in Liking Posts Discussion

Awesome, many thanks ;)

Posted in Liking Posts Discussion

Chris,

Any idea what query I could put in my user model to find out all posts that have not (yet) been liked by the user?

Posted in Liking Posts Discussion

Chris, very useful screencast.

I can get it to work well with just rails, but when I implement ajax I get the following error.

"ActionView::Template::Error (undefined method `likes' for nil:NilClass):"

I've customized it a bit by making polymorphic 'likeable' likes.

Posted in Comments With Polymorphic Associations Discussion

+1

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.