Chris Oliver

Joined

291,060 Experience
86 Lessons Completed
299 Questions Solved

Activity

Check the readme, we have instructions for that. 👍

Posted in How to use Action Mailbox in Rails 6 Discussion

You create a password in the credentials (make one up) and then use that password in Sendgrid's webhook URL. That way Rails can verify the POST request came from Sendgrid (and not someone trying to abuse your app).

Posted in Login with Facebook Discussion

Try using ngrok to expose your localhost to the internet. That will give you a public domain and SSL.

Posted in error with purgecss and Tailwind 2

You're welcome and thanks for all the support! 🙏❤️

I think we didn't have the issue with Jumpstart Pro because I have some examples in the docs or something, so ours didn't get purged.

Posted in error with purgecss and Tailwind 2

There's some discussion about this on the GitHub repo: https://github.com/tailwindlabs/tailwindcss-forms/issues/12

Use a before_action in ApplicationController to check if the user is signed in and has an incomplete profile. Then redirect them to the page for doing that. 👍

Posted in Remote form - update partial in Rails 6

Hey Tim!

This actually might change very soon whenever the "New Magic" DHH keeps talking about gets released.

There are a few good options currently that I like using:

  1. Write a Stimulus JS controller that makes that AJAX request and replaces the partial in the DOM. Rails just needs to render the partial and return that without the layout.

  2. For realtime, you can use CableReady to broadcast the partial from the backend to the frontend with ActionCable. The partial would just need an ID so that it can be searched for and replaced.

Posted in Database structure advice

Hey Amanda!

That is a fun challenge to solve. I wouldn't add that many columns to the table as that would get real tricky to manage. I like the idea of doing a new table, that could work well.

The two options I would consider:

  1. Use a json column and the store_accessor functionality in Rails to store these values in a json field.
  2. Separate table with name and value:integer

Both of these options would let you freely add/remove values as needed. And you can leave the values as nil by default so they don't take up any space if they're not being used.

There aren't too many pros/cons to these. The separate table would just require a join but you can query against json columns in postgres and mysql too so they're similarly equal. I guess if you needed to add any Ruby logic to a value, the separate model would be helpful in that case.

Posted in Please help!!! My App is Down

Hey Houssein,

You should contact support in Hatchbox, not on the GoRails forums. 👍

Posted in New website design!

I do use @apply in a few places like buttons, but that's about it. We talked to Adam Wathan on Remote Ruby Episode #97 about this recently and he advised on not using @apply which was interesting. Definitely give that a listen.

For the most part, I've copied a lot of components from TailwindUI and tweaked them without extracting out my own classes. He recommends using partials or something like ViewComponent instead of @apply.

@Mylan, you can use TailwindCSS 2.0 with Wepbacker! You just need to use the master branch for the gem and node module for the time being. I fixed a bug in Webpacker to make it work the day that TailwindCSS 2.0 came out so I could update Jumpstart Pro for it. 👍

Kieran and I worked on it that night and wrote up our steps: https://www.kieranklaassen.com/upgrade-rails-to-tailwind-css-2/

Posted in How do I renew my plan at the current discount?

It'll renew at the same price. 👍

I've switched to using https://github.com/acmesh-official/acme.sh for SSL on Ubuntu 20.04 and it works great.

Definitely recommend it. It's what we use in Hatchbox.io for SSL.

Posted in Noticed Gem - Twilio is not working

If you set the debug: true option it will print out the request and response:

https://github.com/excid3/noticed/blob/master/lib/noticed/delivery_methods/base.rb#L73-L76

Posted in Introduction to Stimulus Reflex Discussion

Dan, you're correct. If you trigger a reflex, it's just like refreshing the page. That's why I typically wouldn't use Reflex for situations like that where you need to be more efficient. That said, fragment caching can help considerably there. You just have to be careful with what you're doing.

That said, I think Stimulus Reflex killer for just getting something working quick and dirty as a prototype.

Posted in Activity Feed From Scratch Discussion

Hahaha! That is awesome. I loved Digg. I used to watch Diggnation sooo much.

Posted in Inviting Users with devise_invitable Discussion

You can copy their mailer and views from the gem into your app and then make any tweaks you need. 👍

Posted in Duration of a video in the listing page

JP, I'm storing it as an integer, total number of seconds. Then I convert it to whatever display format I want and that gives me the flexibility to change it and/or calculate the total duration of a series too.

You can just assign it to the window variable so it's accessible anywhere I believe.

window.$ = window.jQuery = require("jquery")

Posted in Is Something Wrong With Jumpstart?

Strange! I wonder what's going on.

Another thing you can try is applying Jumpstart to an existing Rails app.

rails new -d postgresql jumppay
cd jumppay
rails app:template LOCATION= https://raw.githubusercontent.com/excid3/jumpstart/master/template.rb

Posted in Is Something Wrong With Jumpstart?

Must be an issue with Spring (it always is shakes fist).

When I run it, it moves right onto the next step:

Webpacker successfully installed 🎉 🍰
You can change application name inside: ./config/application.rb
         run  spring stop from "."
Spring is not running
    generate  devise:install
       rails  generate devise:install
Running via Spring preloader in process 59362
      create  config/initializers/devise.rb
      create  config/locales/devise.en.yml
================================================

Can you try it with DISABLE_SPRING=1 at the beginning? Does that get any further?

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more.

© 2024 GoRails, LLC. All rights reserved.