...accept both optional and keyword arguments is dangerous and should be avoided. This confusing behavior will be deprecated in Ruby 2.7 and removed in Ruby 3, but right now you...
end end colored_p(User.new) # ArgumentError: unknown keywords: first_name, last_name This behavior is not very smart. The easy fix is just to never mix optional and keyword...
simple_format ignores Rails' XSS protection. Even when called with an unsafe string, HTML characters will not be escaped or...
People do. Whether consumers or developers, the end users of software are human beings who care about what's in the software. When the software changes, people want to...
...be slightly off their original value. Consider using DECIMAL instead. Decimals have well-defined behavior for rounding and range overflows...
In RubyMine folders can be excluded from search, navigation etc. by marking it as excluded. You might sometimes wish to...
Sometimes I ran across a GitHub merge request of a gem where it was not completely obvious in which version...
...be aware of its security implications. Both variants have options to change their default behaviour. Search engines and redirects If you have a public facing website that ranks on search...
...not do that and if everything was fine before, maybe just restore the previous behavior by adding environment.loaders.delete('nodeModules') to your environment.js. If you used postcss-cssnext before, add it...
...their expected input (e.g. username, email, current-password, cc-number), browsers can offer a better autocomplete experience. There's a host of possible values. Try it live! Better Mobile Inputs...
One of the many useful features of TextMate is autocompletion of words. If I were in TextMate right now, I...
When deploying Rails applications you might have noticed that JS and CSS are not cached by all browsers.
...of a datepicker or just the english one. Most often you want to import beside the default JS defined in the package.json the styles of the library.
The way that Javascript schedules timeouts and promise callbacks is more complicated than you think. This can be the reason...
...equal $my-great-blue instead of blue. The reason is that custom property values behave differently and allow any kind of value to be assigned (thus not being bound to...
Note Compiling Sass is probably the slowest part of your build, so this is worth a try if you're...
Starting with Rails 7.1 the production logger is set to standard out. For applications running with opscomplete ensure to keep...
Testing file download links in an end-to-end test can be painful, especially with Selenium. The attached download_helpers.rb provides...
If you're frequently switching between projects, you might be annoyed by RubyMines behavior of opening the last project on startup. After all loading a project takes a few seconds...
...a dialog to choose the project to open. This can be set under Appearance & Behavior > System Settings > Project > Reopen projects on startup. Switching to other projects A helpful dialog for...
...Grouping-Results). But this seems not the be the whole truth. Instead the...
...syntax behaves like Go's Ellipsis expression which is used to pass a list as multiple parameters...
...to a Variadic Function. You can use this behavior for example if you want to merge a list of maps into one map: locals { list_of_maps = [ { "key1" = "value1"
Note Don't use reruns as a mean to work around flaky tests. You should always try to fix those...
...a strategy to manually enable certain origins to interchange data. Because CSRF exploits browser behavior, its mitigation CORS is also implemented by browsers. CORS procedure The CORS workflow is basically...
Instantiating ActiveRecord objects comes expensive. To speed up things, you can choose a more direct way to talk to your...
You can define methods in any example group using Ruby's def keyword or define_method method: describe "example" do...
When using many or very long entries of MIME-types that shoudl be gziped in gzip_types directives in nginx...