Nginx Error "413 Request Entity Too Large"
If you get the error "413 Request Entity Too Large" from Nginx client_max_body_size
is too low (default is client_max_body_size=1m
).
This can happen for example during file upload.
Related cards:
Webservice to test and inspect requests
Requestb.in is a webservice that gives you a temporary URL you can use to test request. The page will automatically record and display the latest web request made to it.
How to not die with ActionView::MissingTemplate when clients request weird formats
When HTTP clients make an request they can define which response formats they can process. They do it by adding a header to the HTTP request like this:
Accept: application/json
This means the client will only understand JSON respon...
request_store: Per-request global storage for your Rails app
Ever needed to use a global variable in Rails? Ugh, that's the worst. If you need global state, you've probably reached for
Thread.current
.
When you're using Thread.current
, you must make sure you're cleaning up after yourself. Else, v...
Cucumber: How to avoid VCR errors for unused requests in pending tests
When you have a pending Cucumber step (or feature) that also uses an existing VCR cassette, your pending test may fail at the very end with an error like this:
There are unused HTTP interactions left in the cassette:
- [get ...] => [200...
Simple Form: Rendering errors without an appropriate attribute
Usually you add errors to :base in ActiveRecord, in case no appropriate attribute could be used to add the error.
Simple Form...
Guidelines for Pull Requests and Code Reviews
Projects with more than one developer should always consider to enforce code review even for small changes to improves the overall code health of the system. Here are some guidelines that can help you to accomplish this task.
Github
[How to wri...
How to fix: "Error Bundler::HTTPError during request to dependency API"
If bundle install
shows the following message for you ...
Error Bundler::HTTPError during request to dependency API
... upgrade to Bundler ≥ 1.2.4:
gem install bundler
[Apparently](https://github.com/carlhuda/bundler/blob/1-2...
"The certificate is not trusted because no issuer chain was provided." Error with SSL + Nginx
If you use Nginx with SSL and get an intermediate certificate with your certificate you have to do this:
cat /path/to/intermediate/certificate >> /path/to/certificate
Capybara: Trigger requests with custom request method
Preface: Normally, you would not need this in integrations tests (probably that's why it is so hard to achieve), because it is no actual "integration testing". If you use this step, know what you are doing.
Destroying a record with Capyb...
Custom error pages in Rails
Basic error pages
To add a few basic styles to the default error pages in Rails, just edit the default templates in public
, e.g. `publi...