Sean M

Joined

3,320 Experience
19 Lessons Completed
0 Questions Solved

Activity

Posted in File Uploading with Carrierwave Discussion

Chris, for some reason I can't make it work. Perhaps I misunderstood something. Don't you have a github repo with a code example where I can check what I missed?

Posted in File Uploading with Carrierwave Discussion

Thanks a lot Chris. Somehow your definition is way clearer than in the docs :D

Posted in File Uploading with Carrierwave Discussion

Hey Chris! Do you have any quick wins/ conventions regarding image resizing in carrierwave? At the moment I only use a thumb version with `resize_to_fit [80, 80]` and just realized some of the user profile images uploaded by users are distorted. I checked some rails apps to find an easy solution and basically everybody just uses some kind of combination of `resize_to_fit` / `resize_to_fill` / `resize_to_limit` and doesn't seem to be having any problems with distorted images. Some people are manipulating the images with some heavy minimagick methods, but it seems to be an overkill for me for this purpose. I guess you have some best practices in your apps.

Posted in Forum Series Part 4: div_for Discussion

Chris, how can you use the anchor tag with pagination? For instance you use anchor tag <%= link_to posts_path(anchor: post-#{post.id}) that points to a record which can be found on the 2nd or 3rd page of the posts_path thanks to the pagination. In this case the link_to helper will take you to the top of the posts_path instead of the record since the div tag the anchor tag is looking for can't be found in the DOM.

Posted in Refactoring with the Null Object Pattern Discussion

Chris, this one is awesome. I don't know how I missed this episode before, but I'm glad I just ran into it. Would be amazing to see a screencast where you collect the most important patterns/tricks. I guess there are a bunch of guys including me who don't even know about the existence of them, so you shouldn't even explain everything just let us know about it and mention some resources to read.

Posted in Category filter implementation (perhaps with search)

Hi Chris!

At the moment I have product and industry models with has_many :through associations, and would like to list the products based on the industries. I'd like to create a category (in my case industry) filter kinda like in gorails (https://gorails.com/episodes?tagged=Administration) on the screencasts page or like the rocketclub (http://www.rocketclub.co/startups) implementation.

I guess rocketclub is using AJAX version and you seem to be using turbolinks. What I also realized that your version has the tagged search query in the address bar. Could you tell me the basic differences between the 2 solutions and which approach I should take (in terms of pros/cons, time, etc.)? I couldn't find any really good tuts on this topic, so if you know some, pls share with me!

Btw., what kind of search gem you use for searching in the gorails app?

Thanks a lot,
Szilard

Posted in Upload Progress with Refile Javascript Discussion

Thanks Ariff!

Posted in Upload Progress with Refile Javascript Discussion

@Ariff, thanks for the quick answer! Do you have any code sample for that? I'm not that good at coding yet and not sure if I find the optimal solution. Thanks in advance!

Posted in Upload Progress with Refile Javascript Discussion

@Ariff , I saw your issue posted on refile's github page where @jnicklas suggested to do a roundtrip to the server. Have you found a good solution for that?

Thanks a lot Chris!

Chris, thanks for the quick answer. I had some time to read a bit about it, but I just got more confused. Could you answer the following questions?

DHH wrote on the turbolinks-classic page in the first head tag that: "Turbolinks Classic is now deprecated site" which was followed by "Turbolinks 5 is a ground-up rewrite with a new flow, new events, but the same core idea. It's available at turbolinks/turbolinks. This repository remains available for existing applications built on what we now call Turbolinks Classic."

  1. At the moment I'm using version 2.5.3 (latest on rubygems.org). Should I wait for 5.0 and in the meantime use 2.5.3 with "Turbolinks.ProgressBar.enable();" in one of my js files or should I update to 3.0?

  2. If the latter, is there some issues when you upgrade from 2.5.3 to 3.0. I don't know why but I couldn't find a good tutorial to upgrade to 3.0. I found your video on livecoding.tv about gotchas, but couldn't watch it since the video player didn't play it properly :(.

Posted in Nested attributes with collection_select not saving

Brent, could you post your schema.rb and your race controller? Maybe it's just me, but I don't really understand why you have so many attributes in the relationship model (EventRace).

Hi Chris! I'd like to create a form for a product model, where users can choose a product category first and then can fill the form out. This would be easy, but I'd like to show them different attributes based on the chosen category. Something like if they choose book category, then they will have fields like title, author, published_at, but if they choose shoes category then they can fill out the size, color and type fields. What is the good approach in this case? Should I create more different models like (shoes,books, etc.) or something else? I saw some tuts about dynamic form, but as far as I understand it, I don't need that since the form fields will be predefined and users won't be able to add extra fields.

Chris,

What turbolinks compatible solution (gem or anything) would you recommend for implementing loading progress bar for page load?

Thanks,
Szilard

Posted in Deploying Sidekiq To Heroku Discussion

Chris, another great episode! At the moment I have this in my Procfile: worker: bundle exec sidekiq -c 5 -q default -q mailers, since the only type of worker in my app is the mailer worker. At the moment it's not totally clear for me when/how I have to define the type of the worker. Let's say I would add another type (not mailer) of job to my app, but I don't want to scale my heroku dyno up since my one worker dyno has enough capacity to do both the mailer type and the other type of bg job. Could you tell me how you deal with that? I hope you will publish more videos about getting apps production ready on heroku :)

Posted in Deploying To Production on Heroku with Puma Discussion

Chris, thanks for the super quick answer. Is this free solution good enough for a new production app or you would recommend the heroku addon for $20/month (or something else) to avoid problems down the road?

Posted in Deploying To Production on Heroku with Puma Discussion

Chris, great video again. I had to go thru this 2 weeks ago and I wish I had this video back then. I've got a question which is not about this video, but about the very next step after deploying your app on heroku. So I had bought a custom domain (with google) and set up CNAME/ALIAS records with the pointDNS heroku addon. After that I realized that I need to configure my app over https if I use the custom domain instead of xyz.herokuapp.com. I read a bunch of articles, but still not sure what to choose. If it is possible I'd like to avoid the basic heroku addon solution since it costs $20/month. I've also seen the cloudfare free plan solution (https://www.cloudflare.com/..., but I'm not sure if it's good enough for production. Can you tell us/me pls, which one is the preferred solution here in general (not only from these 2 that I mentioned)?

Posted in Upload Progress with Refile Javascript Discussion

Thanks Chris!!

Posted in Upload Progress with Refile Javascript Discussion

So basically files are stored on S3, and when I try to use them in my app they will be fetched from S3 and get mounted by the sinatra app (to generate different size if pic), so an end user only will see the url as app/attachments? If so, is this the preferred way even if I don't want to display the picture? When I said display in my original question I meant displaying only the filename and the link to the url. My goal is to provide a way for users to send over each other jpeg/pdf/doc/etc. files. If they are interested in checking out a pic/doc/pdf then they can click on the file names which are listed in the app and the files get downloaded (doc/xls) or opened in a new tab with S3 (pdf/jpeg).

Posted in Upload Progress with Refile Javascript Discussion

I will checkout with the CDN, but how can the files be served from myapp/attachments if the files never even touch the app (according to refile docs)?

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.