How to force or redirect to SSL in nginx?

According to nginx pitfalls, it’s slightly better to omit the unnecessary capture, using $request_uri instead. In that case, append a question mark to prevent nginx from doubling any query args. server { listen 80; server_name signup.mysite.com; rewrite ^ https://$server_name$request_uri? permanent; }

What is the difference between “rake db:seed” and rake db:fixtures:load”

rake db:seed loads the data from db/seeds.rb into the database. This is generally used for development and production databases. It’s permanent data that you use to start an empty application. More information here. rake db:fixtures:load loads the test fixtures into the test database. This is temporary data used solely by the tests. You can think … Read more

Uploading a file in Rails

Update 2018 While everything written below still holds true, Rails 5.2 now includes active_storage, which allows stuff like uploading directly to S3 (or other cloud storage services), image transformations, etc. You should check out the rails guide and decide for yourself what fits your needs. While there are plenty of gems that solve file uploading pretty nicely (see https://www.ruby-toolbox.com/categories/rails_file_uploads for … Read more