Activity
Posted in Active Storage and Subdomains
Ah, that'll get you! Good idea about adding that. It's pretty common, either that or one of the alternatives like libvips that's supposed to be faster.
Check that your code is configured to use the ENV var. Enable logging for faraday, etc to see what request its making.
If you set it up with Hatchbox, then it will do all that for you.
I SSHed into your server and confirmed Hatchbox setup everything correctly.
curl http://10.138.104.120:9200
{
"name" : "living-recipe-elasticsearch",
"cluster_name" : "elasticsearch",
"cluster_uuid" : "_na_",
"version" : {
"number" : "7.5.1",
"build_flavor" : "default",
"build_type" : "deb",
"build_hash" : "3ae9ac9a93c95bd0cdc054951cf95d88e1e18d96",
"build_date" : "2019-12-16T22:57:37.835892Z",
"build_snapshot" : false,
"lucene_version" : "8.3.0",
"minimum_wire_compatibility_version" : "6.8.0",
"minimum_index_compatibility_version" : "6.0.0-beta1"
},
"tagline" : "You Know, for Search"
}
Sounds like your code is misconfigured. Make sure that it's loading from the ENV var.
You said you logged into the ElasticSearch server and tested it, but if Rails is running on another server, you have to make sure ElasticSearch is attached available externally. You'll have to make sure it's binding to an IP and allowed through your firewall.
Posted in Hatchbox deployment questions
Nice, so just fix your active storage config and try again. 👍
Posted in Hatchbox deployment questions
Have you checked the NGINX logs to see what the error is booting your app?
Posted in Hatchbox deployment questions
👍
Posted in Hatchbox deployment questions
Make sure the node module is in your package.json as a full dependency, not dev dependencies.
Posted in Hatchbox deployment questions
Posted in Hatchbox deployment questions
Actually it's the contents of credentials key file.
Posted in Hatchbox deployment questions
Did you forget to add your RAILS_MASTER_KEY env var? That's usually what people forget.
Posted in Hatchbox deployment questions
Like I mentioned, you just need to set the ENV var. You don't have to update the database.yml because the env var will override it.
Posted in Hatchbox deployment questions
Just set the DATABASE_URL env var to point to your database. That's it!
Yeah, AJAX requests don't work like a normal form submit. Redirects won't be followed by the browser like a normal page view, since you didn't make a normal request. You can redirect client side in the success callback if you want, or have the server do it in a create.js.erb response.
That works too! And will allow you to send files as well.
Hey Gus!
You would just pass in a Javascript object into it, similar to a Ruby hash.
Rails.ajax({
url: '/donations',
type: 'post',
data: {
amount: 900,
}
})
Or
params = { amount: 900 }
Rails.ajax({
url: '/donations',
type: 'post',
data: params
})
Posted in Active Storage and Subdomains
I'm not real sure on this one, let us know if you find more details. I didn't find much on a quick google search, but I thought that Rails would automatically use the current request's subdomain/domain so you wouldn't have to do anything.
Posted in Customizing the Jumpstart app template
Hey Dean!
You don't have to use an SVG, but it's helpful and what we recommend because you can grow and shrink an SVG without it getting blurry.
You'd use Adobe Illustrator, Inkscape, Sketch, Figma, etc to create an SVG.
render_svg
is a wrapper around inline_svg that we made so it embeds your SVG contents into the page and saves making another HTTP request to make your site faster.
If you want to use a png or jpeg, you can just replace that with a regular image_tag that points to your logo.
Posted in Configure ruby projects of old version
This would help you create new Rails apps with different versions. Bundler already handles separate Rails versions for each app, so that's already handled for you. It installs whatever is in the Gemfile and uses that. Sometimes you may need to run "bundle exec rails" to make sure it uses the app's Rails version, not the globally installed version.
Posted in learning ruby
You can definitely become a junior developer without knowing math super well. One of the nice parts about web development is that you are primarily working with HTTP requests and strings, not math. It's a great area to be in and unless you're building algorithms or something super performant, you won't have to worry about much math being involved day-to-day.