Activity
Hey Ryan,
These are great questions, and everyone's probably going to give a slightly different answer.
Rails really has tried to avoid answering that question. Basecamp (who created Rails) doesn't use a framework, and doesn't generally build anything super Javascript heavy, so they just write plain Javascript.
I've really enjoyed using Vue.js myself and know that the Laravel community has too. I've done several videos on this which you can see here: https://gorails.com/series/using-vuejs-with-rails (there might be some others not in this series).
I generally try to work without a framework if my application is simple. GoRails, for example, doesn't have much Javascript at all and therefore I'd rather just write plain JS. For something more complex that might use websockets or be much more interactive (like Trello for example) then a JS framework really starts to make sense.
A new series I'm starting shortly is going to be building a Trello clone with Vue.js which might answer some of these questions for you too. That should begin in the next week or two.
Not at the moment, but that's as simple as adding a couple lines of code to your JS. Check out the route examples: https://hpneo.github.io/gma...
I mentioned the geocoder gem comes with some calculations methods. One of those is for distance between two points. You can use that, just check the readme.
Posted in Coffeescript 2 Rails Asset Pipeline
According to this (https://github.com/rails/ruby-coffee-script) it looks like the coffee-script-source gem would need to get updated to the latest version to use the standard coffee-rails gem that we're used to.
https://github.com/rails/coffee-rails
Making updates to those gems would probably be the best way to do things since it would work exactly as we've used Coffeescript in the past with Rails.
Hey Sai,
Your browser has a maximum size of storage for cookies, so Rails protects you from sending too much data to the browser.
You should probably look at what you're storing in the cookies and change it to save to the database and store the database record ID in the cookie instead.
Before the screencast, I setup a Rails app with my template and added a Transaction model ahead of time so I could focus on the geocoding parts I believe.
You can check out the commits in the repo to see how I set that up: https://github.com/gorails-...
And sometime soon, I will probably be releasing that Rails template that I've been using to start new apps!
Posted in Sortable Drag and Drop Discussion
Yeah! Popper is nice to have instead. Screencast was using an old version of my Rails template which has been updated already, just hadn't done a git pull recently on that machine. Should update that in the repo.
Yeah, it's encouraged for production, because production will boot faster. The extra RAM usage is going to come from the cache it because that's how it boots faster. It's trading RAM for speed.
Certain memory constrained environments, like Heroku typically is, may not be a great place to do this if you're struggling to keep your app's memory usage down. Otherwise, you should basically use this all the time.
All the routes are handled by Rails in these videos. Vue is just pointing to the Rails routes to submit things to the server.
Not as difficult as you might think. The HTML5 geocoding API will get you an IP address quickly, so you can send that over as a different param and pass that into the .near() method. This will be a great screencast. :D
Posted in Exception/error reporting from live.
Just an FYI, you don't have the use the Heroku addon. You can go straight to bugsnag and set it up yourself if you want. The addons are just there to make it slightly easier to setup.
Sure can, do you have any topics you're curious about?
Posted in How can I integrate Amazon Native Ads
I don't think that gzip has anything to do with it since it's all controlled by Amazon.
Are you able to paste that Javascript into another site somewhere and see if it runs? I tried to inject the snippet on to a page and didn't see anything at all show up. I'm wondering if it's something to do with your Amazon snippet.
I covered how you can do this with the Apartment gem as well as from scratch in these episodes: https://gorails.com/series/multitenancy-crash-course
Posted in Exception/error reporting from live.
Another tip: You can also run an errbit server which is an open source version of Airbrake and use the airbrake gem to talk to it which is kind of nifty.
I wonder if that got triggered along with the JS for Stripe. May need to update my screencasts to mention that if I didn't cover that properly.
Can't we just have nice things that work out of the box?? 😜
Did you have local: true
on the form_with
?
Posted in How can I integrate Amazon Native Ads
Well, that's sorta good. We know it's running and it's hitting the URL so both of those tags are running.
Do you have a link to a page that you can share with this on it? I was going to poke around and see what's going on. I haven't ever used their ad widgets before myself so I'm not sure what to expect.
Posted in How can I integrate Amazon Native Ads
Hey Alex,
I haven't actually played with this myself, but you may need some adjustments to make this work with Turbolinks, although you also might not.
Generally if you're putting script
tags in the body
, Turbolinks will make sure they get executed on the second pageview. You can put a console.log
inside the tag that sets all the variables there and see if it prints out when you navigate around.
Since this stuff looks like you're putting it inside the body
tag, you should be fine but you may have to make some adjustments.
Can you try putting a console.log
in that first script tag and make sure that one prints out each time?
Posted in Let's Encrypt Error on Hatch
One thing you can try is to run these two commands on your server:
sudo apt-get clean
sudo apt-get update