Activity
You can also use .none? to check the opposite as well. 👍
Yes, you can definitely do that. Maybe I'd do that for different things like "admin" area components and so on.
Basically just one controller per feature. You should never do page specific JS or CSS because that means you can't move your features to different pages on your site later on which inevitably always happens.
Posted in Setup MacOS 10.13 High Sierra Discussion
You should never use sudo to install gems. If you get permission denied, you didn't get Ruby installed correctly and should go through those steps again.
This section in the docs mentions that you can only use hyphens in the controller name in your html. It maps to either a hyphenated or underscore controller.js filename though. https://github.com/stimulus...
And yeah I think this is a nice clean way of refactoring those CS classes. You no longer have to deal with managing event listeners and can purely focus on the code that runs for each event. 👍
Correct. The server doesn't have a clue who you are unless you give them a JWT or a session cookie. Your browser automatically sends cookies over in every request so it makes things easy that way. With JWTs, every request your code makes to the server must manually include it.
Yeah, Vagrant is probably what you'd want in this case. Docker is more for you to containerize your app so it could run anywhere, not necessarily for mimicking your existing production host.
You'd just want to install the same OS version as prodcution and the same packages in Vagrant.
I get the feeling that Basecamp won't build out those kinds of features and will keep this generic, but it is the perfect opportunity to build a library on top of stimulus to make validations easy I would imagine.
Hit me up with your questions! I'm still learning it too, but the good news is that it's pretty straightforward so there isn't _too_ much to learn.
You're welcome!
Btw, you can remove the duplicates of those lines and that should work fine if you want.
export PATH="$HOME/.rbenv/bin:$PATH"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"
eval "$(rbenv init -)"
I'd guess that p[robably is coming from this command (line 10) https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/rails/rails.plugin.zsh#L1
I'm not quite sure why it isn't finding the rails command though. Maybe the Rails command isn't in your PATH in ZSH and when you load bash it updates your PATH?
Have you added rbenv's stuff into your .zshrc? That's probably it if I had to guess.
There are many ways to talk to an API. HTTParty, RestClient, etc are all options you could use.
That's really cool, thanks for sharing!
Posted in Modern Webpack template on Rails 5.1
Hey Jiri,
I think you're right for the most part. I believe you could just move those assets folders into app/javascript/pack
and you'd be able to use reference them from there.
You could probably put it in the vendor
folder since you wouldn't really want to edit these files, but that may just require you to import the files into webpacker a bit differently.
You might have to say like import X from '../../vendor/assets/index
or whatever. It'll take some experimenting.
I think the vendor
folder is the ideal so you aren't tempted to edit any of those files to make updating to newer versions of the template easier. That said, don't let that stop you if you can get it working in app/javascript
easier. A running app is more useful than a perfectly organized one. You can always move the files around after you get it working.
I did an episode on that here: https://gorails.com/episodes/consuming-an-api-using-httparty-and-creating-a-gem
It's using the HTTParty gem, but you can also use like RestClient as well which I believe I've talked about in an episode or two as well.
I'm using github.com/carlhuda/janus which works on anything. It's close enough with shortcuts to Sublime Text that it was a pretty easy switch.
Just remember, with Vim all you need to learn at the beginning are enough basics to get you going. Then you can take time to learn more complicated things.
Awesome! Good luck with your new job!!
Hey Kelvin,
I did a couple episodes on caching and Redis:
https://gorails.com/episodes/russian-doll-caching-with-rails-5
https://gorails.com/episodes/gorails-performance?autoplay=1
And fixed. The solution is to add the "key" property to the loop so it can differentiate which items have changed.
card v-for="card in list.cards" :key="card.id" :card="card" :list="list"
Those will be covered shortly! Just want to finish up this series real fast first. :)