Chris Oliver

Joined

293,010 Experience
93 Lessons Completed
296 Questions Solved

Activity

Posted in TailwindCSS Admin Theme

I like using Tailwind UI so I can mix and match components / layouts to create what I need since I have to customize themes anyways.

Posted in Setup Windows 10 Discussion

Thanks, removed the link. 👍

Posted in Jumpstart Pro - Installing Dependencies on Cloud9

Also just pushed up a branch for devcontainers which you can use in VSCode or GitHub Codespaces (which is similar to cloud9) https://github.com/features/codespaces

Posted in Jumpstart Pro - Installing Dependencies on Cloud9

You'd need to install Ruby, Postgres, and Redis on Cloud9. We did a screencast on Cloud9 here: https://gorails.com/episodes/aws-cloud9-ruby-on-rails-development

Posted in How to use <script> in Rails 7

Nope, partials start with an underscore. The js.erb extension is the format + the renderer. So this example is a response for the js format and rendered using erb.

Posted in How to use <script> in Rails 7

You can have a controller respond to the JS format.

respond_to do |format|
  format.js
end

And then render a action.js.erb file

Posted in Bundler's New Ruby Version File Option Discussion

You could also use delete_prefix so you can leave the .ruby-version file as-is. 👍

ruby File.read(".ruby-version").delete_prefix("ruby-").strip

Posted in How can I upload HEIC format images?

I believe you need to compile imagemagick with heic support. It doesn't always come out of the box (sometimes because of licensing issues).

Posted in Can NOT watch videos in China !!!

Only the free videos are on YouTube. I don't know that we will move them, but you could use a VPN to access them from another country.

Posted in Rails Components From Scratch Discussion

Yep, you would want to treat them as a view specs because that's what they are. view_context is an instance of ActionView::Base. 👍

Posted in How much does it cost to built an e commerce app ?

Solidus is an open source Ruby on Rails e-commerce platform you can use: https://guides.solidus.io/

Posted in Rails 6/7 Template Recommendations for SaaS

Hey Michael!

Jumpstart Pro doesn't require a subscription. The subscription gets you access to updates (like the upcoming Rails 7.1 and Ruby 3.3 upgrades), but you can cancel anytime and keep working on your app.

You can also use our Pay gem if you want to build your own template and add payments completely free.

Alternatives like BT are kind of shady unfortunately and hide their pricing which is $349/year for Stripe integration. That's $100 more than our Jumpstart Pro Rails SaaS template.

Posted in Rails Components From Scratch Discussion

These are my favorite kinds of things to learn and teach. Learning behind the scenes really helps you become a better developer. 💪

Posted in Better Debugging With The Ruby Debug Gem Discussion

That's a great tip!

VS Code also has an extension you can use https://github.com/ruby/vscode-rdbg

The other option is to replace foreman with overmind which allows you to do the same thing by opening another terminal and running overmind connect web to connect to the process. This will work with binding.irb, pry & debug or anything else.

Here's my bin/dev

#!/usr/bin/env sh

PORT="${PORT:-3000}"
export PORT

if command -v overmind > /dev/null 2>&1; then
  exec overmind start -f Procfile.dev "$@"
else
  exec foreman start -f Procfile.dev "$@"
fi

Posted in Rails Components From Scratch Discussion

Glad you found it helpful!

Posted in Rails Components From Scratch Discussion

The refactoring part is half the fun. 😄

Thanks Kylo Ren!

Posted in Rails & Vue.js Trello Clone - Part 1 Discussion

Yeah, thankfully webpacker is no longer the way to go. Unfortunately Rails didn't pick just one option to replace it, they left it open ended.

Personally, I use esbuild with https://github.com/rails/jsbundling-rails.

Posted in Routing Concerns and Scopes in Rails Discussion

Interesting. I don't think I've seen this documented anywhere. It seems like it would filter out the only: and other options and the leftover ones are set as defaults?

I know you can do this:

resources :todos do
  scope defaults: { record_type: "Todo" } do
    concerns :likeable
  end
end

Just recorded a Routing Concerns in Rails screencast using routing concerns to refactor this further.