Chris Oliver

Joined

247,110 Experience
18 Lessons Completed
271 Questions Solved

Activity

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.

Posted in bash to zsh

Oh yeah! I forgot about that change recently for Catalina. You probably want to use ~/.zshrc instead now.

Posted in Deploy Ubuntu 18.04 Bionic Beaver Discussion

Sounds like you're simply missing the RAILS_MASTER_KEY env var. Set that up so that Rails can decrypt the credentials and you will be set.

Posted in Configure ruby projects of old version

You can do:

gem install rails -v 5.1.7
rails _5.1.7_ new myapp

Here's a gist that contains Reddit's popularity algorithm that you could use. It's pretty simple and just uses upvote, but you could add in comments and impressions to the calculation too. https://gist.github.com/nanosplit/db42e507c5d1d984b664868db10a3669

This is another approach that you should check out. https://www.akitaonrails.com/2016/10/31/ruby-on-rails-implementation-of-a-proper-ranking-popularity-system

Posted in Is Gorails's jumpstart worth the price?

There was a good little discussion Reddit about it. I also posted some notes about it there as well to help explain the difference between the free and pro versions: https://www.reddit.com/r/rails/comments/drl0q2/is_gorailss_jumpstart_worth_the_price/

Hope that helps, but if you have any other questions I'm happy to help!

Posted in Ruby on Rails ActionMailer Images Issue

Hey Maximilian!

I haven't actually done this before, but it looks like you're mostly on the right path. I found this on Stack Overflow that looks very similar. https://stackoverflow.com/a/25810153

Does the email have the image as an attachment and it's just not showing inline?

Posted in Deploy Ubuntu 18.04 Bionic Beaver Discussion

Sounds like you missed the exec $SHELL step.

Posted in Can not use toast of bootstrap in rails

Sounds like you missed a step. I just updated the repository to include toasts in the example and they work just fine.

https://github.com/gorails-screencasts/bootstap-with-webpack-4/commit/49846a028f0d6674b0024fbd4c1f6051c8757884

Compare your code with the repository and see what you missed.

Posted in How to use Bootstrap with Webpack & Rails Discussion

Sounds like you missed a step. I just updated the repository to include toasts in the example and they work just fine.

https://github.com/gorails-screencasts/bootstap-with-webpack-4/commit/49846a028f0d6674b0024fbd4c1f6051c8757884

Compare your code with the repository and see what you missed.

logo Created with Sketch.

Ruby on Rails tutorials, guides, and screencasts for web developers learning Ruby, Rails, Javascript, Turbolinks, Stimulus.js, Vue.js, and more. Icons by Icons8

© 2020 GoRails, LLC. All rights reserved.