@Ivan, no, not during deploy. You should already have done that so they're added to your package.json. The assets:precompile step will make sure they're installed during deploy.
Heroku does need you to add the node buildpack alongside the ruby buildpack so you can use yarn.
heroku buildpacks:add heroku/nodejs heroku buildpacks:add heroku/ruby
That's actually using the data-confirm-modal gem to use Bootstrap instead. It's kind of hacky how it replaces the confirm method in Rails JS, but you can check out the source here. https://github.com/ifad/data-confirm-modal
iTerm is so dope, thanks for sharing that! 🙏
Yeah, one of the reasons I choose to use Minitest over Rspec is that it's mostly just pure Ruby. You have a couple wrappers around
assert, but it's really just Ruby code. Less magic means it's more reliable to reason about.
Headless browsers I do believe can still generate screenshots. I will try it to make sure. The main reason you need a headless browser is on your server, you don't have a screen, so there's no windows to actually render. It's all virtual.
Posted in Rails 6 + ActiveAdmin + ActionText
Administrate has a plugin or two for ActionText if you are adding an admin.
And probably the best long-term approach would be to just build it yourself that way you have full control over how the CMS works and aren't fighting with an admin gem. That said, it's a lot more work so may be something to do later on.
Create new ones like
has_many :old_associations, foreign_key: :old_id or whatever options are necessary.
You can specify the column on your association that's used for joining tables. You'd just specify that
old_id column and you should be good to go.
Posted in Multitenancy with Apartment Gem
@Vitor the Apartment docs should have a good explanation for that. 👍
I would use a Stimulus controller to listen for "change" event on the radios and then update the hidden fields accordingly.
You can either:
- Add some code to the model to transform the selected value here to what you want in the attributes
Seems like a perfect use case to me. You can add / remove options easily in the future without adding more migrations and that'll make maintaining the filter and options a lot easier.
You might look into some of the gems that enforce types on the options if you need to make sure things are cast to booleans, ints, etc.
Posted in Authorization with Pundit Discussion
Might just be a temporary issue on Wistia. It's not loading for me either.
Oh nice! I haven't made the upgrade quite yet.
Anything in particular you'd want to see? Mostly it operates the same as bash, just with a few niceties and you can use things like oh-my-zsh which I believe I talked about in this episode: https://gorails.com/episodes/my-development-environment-for-ruby-on-rails?autoplay=1
Mostly I just look at ruby-lang.org for the notes in the blog posts.
Posted in Where is the search bar?
Posted in Where is the search bar?
Try using the search icon in the navbar.
This would be a good one for the Rails github issue tracker.
I would bet they don't have that by default, but could probably be done by pasting the Rails source into your app, editing the toolbar for Trix, and then including your modified copy instead of the Rails JS for it.
ActionCable works great for this. Once the background job retrieves the data, you can have it send an updated partial over to the user and replace it on the page. I do this for server and app status updates on Hatchbox. Works great.
Posted in Ruby & Rails Courses
Awesome! I've got a long weekend out of town, but when I get back I can probably crank on a few episodes that start from the very basics.
I don't think there's any way to do this in the database with the current setup, so what you're doing is probably what I would do.
You could cache the results of the report and re-calculate them every day or week on a regular basis so you don't have to run this expensive calculation all the time.
I'd probably stick with what you've got.