Monroe Mann

Joined

6,750 Experience
53 Lessons Completed
1 Question Solved

Activity

Ahh, I see. I’m sure the advanced users will understand better.

What would be great is:

  • An example of a basic use case as you suggested
  • A tutorial how to switch from the earlier notification system to this new system

It looks quite amazing—it’s just overwhelming for someone at my level.

Thanks for the reply Chris!

Not sure anyone else finds this really difficult to understand. The original videos on adding notifications were very 'step by step' with clearer explanations. This seems like it's documentation for an expert coder. I fear anyone who is intermediate or lower is not going to be able to follow this. I certainly won't be able to implement this myself...

Posted in ruby on rails nested model relationship and routes

You're welcome Mike!

As for never nesting more than 1 level deep, that doesn't make sense to me, because in our situation, it makes perfect sense: Resources -> Sections -> Resource Links. And they ALL have to be linked to one another. So we have a bunch of resources (for example, Python), then we have 9 sections for Python, and each of those sections have individual links for that particular part of Python study.

I agree that you shouldn't have infinite nesting, but going 2 or 3 levels in is still manageable, and helps to keep our database very organized.

As for a good starting point, I feel that the ruby on rails guides are sometimes more confusing than other resources (at first). While I haven't checked out Richard's suggested blog post, I do know that absolutely nothing made sense until I found that digital ocean tutorial I shared above. After I read that, everything made sense.

As for Friendly ID, once you get things routed correctly, if you have issues still with FriendlyID, let me know!

If you need to do nested routes, this is one of the best tutorials I have found. Every rails coder should read this: https://www.digitalocean.com/community/tutorials/how-to-create-nested-resources-for-a-ruby-on-rails-application It doesn't go into detail on how to do double nested routes, but the principles are similar, with a few variations. For example, with three nested resources: dog, allergies, medications, for example, the most deeply nested path will be something like: dogs_allergies_medications_path. It took me a while to wrap my head around it, but eventually it made sense. Another lesson: with routes, you can pass multiple models through as parameters, and in fact, you have to in order to get the routes to work, like [@dogs, medications].

Once set up, using friendly ID is straightforward. The key is to first get the routes working normally. Then add friendly URLs thereafter.

Mike, I can help you with that. I finally figured it out. You can email me: [email protected] I can also post how it is done here.

You can see it in action at breakdiving.io/resources/javascript to see how we are doing just that. Come join us :) It’s free to join.

Posted in Multiuser Live Video Chat in Rails Discussion

Thanks Chris! This is something we can investigate creating if we decide to move away from Zoom! Or, if this turns out to be more affordable than zoom :D

There is something called the Jumpstart Gem. It is created by Go Rails. It allows automatically installs many gems and css for you and sets up basic models and controllers so you are all set from the beginning.

Looks great! What's the main benefit to using Stripe with Pay, rather than Stripe solo? We have Stripe subscriptions already set up on our site. Would this augment what we already have?

Posted in Building AnimatedGif.me Part 1 Discussion

This is awesome Chris! Thanks so much! This will help me and my team better understand rails coding from start to finish!

Posted in Test Driven Development Basics Discussion

What is the test suite that Chris is using here? Is there a book that shows how to use this test suite?

Posted in ruby on rails nested model relationship and routes

Chris, it would be really great to see a video on how to set up nested routes properly. I have looked at every tutorial online, and nothing makes sense :D

Hi Ivan,

Above you wrote: "You will have to create the new and create methods for the journal of course for the form to work."

But later you said that "You would be initiating the form from your posts controller show or index methods."

Do I still need to create a new and create method for the journal? In a new journal controller, or in the posts controller? I think that's the last thing that is confusing to me.

Thanks very much!
-Monroe

Hi Ivan!

Thanks for this incredible assistance. I think I understand enough to try to get it working. I will report back how things go, and if I get stuck.

Monroe

Just wanted to truly say, "THANK YOU" to Chris Oliver. If it weren't for this amazing community, my team and I would be lost. It's because of him, and the wonderful people like you reading this who always answer our questions, that we are consistently making progress on our code base.

As a team of relative beginners, it's so nice to know we can always find friendly and supportive people here at GoRails. All of you also deserve a big round of applause.

Hi Ivan, a few questions, kindly:

1) Why would current_user.posts load a list of read posts? Clearly I am missing something, but it seems like current_user.posts would list all posts (read or unread) by the current user.

2) We actually want to show only the posts that have not been marked as read. To provide context, it's a message board, and we have a section called 'Hot Topics' which shows posts that have comments within the last 10 days. As soon as you comment on a hot topic post, it is removed from the hot topics list. But sometimes, you just read it, and decide not to comment. Users should still have the option to remove it, to reduce their hot topics list. So we want to put a 'mark as read' button on each hot topic. Then we will check to see if the post is 'hot' (has a new comment) and also 'unread'. Only if both criteria are satisfied, will it display. And any time a message is marked 'unread', if a new comment is added thereafter, it will again be marked as 'unread' and 'hot', and therefore, will again be displayed.

3) How do we actually set up the routes for this? Do we have to modify the routes file? Do we have to add anything to the form itself, so it knows where to 'post' to?

Ivan, this is wonderful! I am going to read through all this, and will get back to you with questions! Thanks for taking the time to provide such a thorough answer. I think it will help many others too!

I was looking at the unread gem but it seems a bit complicated and many seem to run into difficulty with it.

Instead, I was thinking of adding an 'already_read' column (boolean) to the post model.

But then I ran into two problems:

  1. How to ensure that the already_read column is only updated for the current user
  2. How to create the correct route/method so that when user clicks 'mark as read', it updates the database

Anyone have any thoughts or ideas? Thank you!

I too would love to know how to do this.

Posted in How to Add Pagination with Pagy Discussion

Oh that's exciting! Since we just got the prior version working, will it be easy to upgrade? Do you recommend we do so, or stick with what we now have working? Thanks Domizio.

Posted in How to Add Pagination with Pagy Discussion

Hi Domizio,

Thank you for this. My team and I only found the Quick Start doc. We must have missed the other docs. If you haven't already, perhaps post these four links prominently at the top of the read me? Maybe they are there, but we couldn't get it to work until we watched Chris' video. Not a criticism: just helpful (we hope) feedback from actual users. We love Pagy and thank you so much for creating it!

-Monroe
BreakDiving.io

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.