Chris Oliver

Joined

270,750 Experience
26 Lessons Completed
296 Questions Solved

Activity

Posted in Finding video

The other episodes in the series are Pro episodes. That's why they're only previews on YouTube.

https://gorails.com/series/rails-hotwire-actionmailbox

Hey Tommy!

You would probably need to do this with wildcard URLs and then parse them.

# At the very bottom of your routes file so it doesn't override other GET routes
get "*place" => "places#show"

This should assign params: { place: "walkable-places-in-europe"}

And you could parse that string with Regex or similar to get your filter and location out of it in the controller.

Posted in Nesting resources & controllers best practice

I almost always nest them in folders. It's very helpful when your app grows. Often times you might have 2 or 3 controllers with the same name that do different things and the nesting in folders helps separate them out.

For example,

websites/pages_controller might be for website editor
subdomains/pages_controller might be for people viewing the website
admin/pages_controller might be for the business owner (you) to do customer support

Posted in Nesting resources & controllers best practice

Hey Tom,

You're on the right path. The controller would be "nested" or similar. Basically, you'd lookup the Website before you lookup the Page (so you can make sure you only display the website's pages and no others).

You can do that with nested routes like /websites/1/pages/2. Here, your controller would look up the website with Website.find(params[:website_id]) from the URL.

Also, you could use domains / subdomains to lookup the website. Then you wouldn't need nested routes and you could have subdomain.example.com/pages/2. In this case, your controller would do Website.find_by(subdomain: request.subdomain)

Not really. They tried that with webpacker and it didn't work because things change so often and every app needs flexibility to adjust for their use case.

The way JSbundling is setup, you can use any tools you want. The only requirement is they dump to the asset pipeline. That's super flexible and you can make any changes you need. Great balance I'd say.

I had the exact same thoughts!

I don't believe you'll be able to use .js.erb responses in Turbo going forward. They're pretty much replaced by TurboStreams. 👍

Posted in Deploying Tailwind to AWS Elastic Beanstalk

No package nodejs available

Sounds like your nodejs repository hasn't been loaded / updated so it can find the nodejs package.

Posted in Deploying Tailwind to AWS Elastic Beanstalk

  1. You should install node LTS instead of 12.x, that way you'll always be on the stable version.
  2. The error says you're trying to install Yarn without nodejs. You should install nodejs either before or at the same time as you install yarn.

Something like this is more what you want I imagine:

01_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_12.x | sudo bash -"
02_install_nodejs:
command: "yum -y install nodejs yarn"

Posted in API CRUD Actions Discussion

Yep, it's released as the vultr gem! 🚀

https://rubygems.org/gems/vultr

Posted in This website is under heavy load (queue full)

Skylight (my favorite), AppSignal, New Relic, etc are useful as they'll monitor your app's response times and can help you pinpoint slow stuff like queries or views.

Posted in This website is under heavy load (queue full)

Sounds like a lot of requests all came in at once. That's can happen when you're load testing, have a big spike in traffic (like launching something new) or if you're getting attacked by malicious users.

You can increase Passenger's queue size configuration, but it may just fill up the larger queue if Rails isn't processing requests fast enough. You might want to check and make sure that your response times in Rails are not slowing down with slow views / queries.

Posted in How to add overrides to a rails app?

Typically you'll just want to fork the original repo and merge updates from it. That's what we do for Jumpstart Pro when users want to pull in updates.

Posted in Host PHP without breaking Hatchbox?

Maybe Apache was a dependency of something you installed? Definitely can't have it running or else they'll conflict. 😅

Posted in Jumpstart App get's stucked with wrong login data

Fantastic! Let me know if you run into any other issues! We're still working on Madmin, but it should do all the basics nicely.

Posted in Host PHP without breaking Hatchbox?

I hear you! It wasn't my thing either, but it is now I guess. 😜

Posted in Jumpstart App get's stucked with wrong login data

Alrighty, pushed fixes for that. If sign up or login failed, it would just hang. Those are both working now. 👍

Posted in Host PHP without breaking Hatchbox?

Enabled the language option for your account. 👍

Posted in Host PHP without breaking Hatchbox?

You can add your own sites in /etc/nginx/sites-enabled/mysite. Just don't use a name that matches an app name in Hatchbox.

Hatchbox doesn't really make any adjustments to the NGINX config other than enabling Passenger, so you're free to add PHP, etc. 👍

I actually have a private beta in Hatchbox that lets you choose a language when you deploy an app. You could deploy your PHP scripts from there (I've tested Laravel and Wordpress I believe). I'll have to add enable that on your account and you can then select the language when you create a new app.

We're working almost finished with the first version of Hatchbox v2, which switches to ASDF so each app can specify their language (and versions) so in the future you'll be able to deploy PHP apps. 🔥

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

© 2021 GoRails, LLC. All rights reserved.