All threads / Repost / Retweet / Reblog Discussion

Ask A Question

Notifications

You’re not receiving notifications from this thread.

Repost / Retweet / Reblog Discussion

Thanks Chris! Sure, would love to see the follow and following relationship added to this in future.

Reply

Thanks Chris!! Would love to see the follow and following relationship added to this in the future too

Reply

Hi Chris, Great tutorial! I was wondering how to setup liking posts when I don't have any user records. Assuming I want to setup it for my blog and for sure I'm going to be the only user so how could I implement it?!

Reply
This was just what I needed, man. I tried to build out this feature myself and I ended up making it way more complicated than it should have been. I also now understand a few more things about Rails, so thanks for this. 
Great to hear Dan! Let me know if there are any other features like this you'd like to see!
Reply
Hey Chris, you may have forgotten one important component for this feature. The unsharing AJAX button for the second state. Currently, my repost feature breaks when I mistakenly double click and record the changes into the db. Can you provide a quick update to this solution to balance it out and then post the updated repository link? Thanks!
Reply
Its such a unique solution that its very hard to alter without complicating the logic. Also, we should be able to get the count for the shares, and also access the users that shared the posts. Example: rebecca, john, toby, tyler shared.
Reply

Any help on this please; how can I count the number of times the original tweet has been retweeted?

Retweets is simply a count the number of associated tweets.

@tweet.tweets.count

Reply

Thanks for the quick response Chris.
I have tried @tweet.tweets.count on the tweet show page but I'm getting an error " undefined method `tweets' for #Tweet:0x007ffcab0608d8
Did you mean? tweet
tweet= "

This is showing in the console

=> #<ActiveRecord::Relation [#<Tweet id: 1, user_id: 1, body: "First tweet", tweet_id: nil, created_at: "2018-09-06 04:14:56", updated_at: "2018-09-06 04:14:56">, #<Tweet id: 2, user_id: 2, body: "second tweet", tweet_id: nil, created_at: "2018-09-06 04:16:58", updated_at: "2018-09-06 04:16:58">, #<Tweet id: 3, user_id: 2, body: nil, tweet_id: 1, created_at: "2018-09-06 04:25:34", updated_at: "2018-09-06 04:25:34">, #<Tweet id: 4, user_id: 1, body: nil, tweet_id: 2, created_at: "2018-09-06 04:54:44", updated_at: "2018-09-06 04:54:44">, #<Tweet id: 5, user_id: 1, body: nil, tweet_id: 2, created_at: "2018-09-09 12:09:01", updated_at: "2018-09-09 12:09:01">

Apart from this, everything else work fine for me in this tutorial.

Reply

Any solutions for the challenge at the end to add a modal with the ability to add a comment to a retweet?

main thing im struggling with is the form in the modal to add the comment (body) for a retweet

Reply
Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 33,665+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    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.