After upgrading to Rails 6.1.7.2 one of our apps printed a wall of warnings while booting: /var/www/app/shared/bundle/ruby/2.6.0/gems/net-protocol-0.2.1/lib/net/protocol.rb:68: warning: already...
Capybara gives you two different methods for executing Javascript: page.evaluate_script("$('input').focus()") page.execute_script("$('input').focus()")
...new value (be aware that you should use a secure and salted hash) or better call the the_user_to_log_out.reset_remember_token! method that does the things for you.
We forked trusty memoizer to make two changes: Memoized methods now preserve their arity. Previously all memoized methods had an...
...iterated until the final design is ready – shiny, accepted and ready for implementation. I believe this works well when you get to work with the final decider in person.
ActiveRecord provides the ids method to pluck ids from a scope, but what if you need to pluck Global IDs...
Note that you should disable the Java plug-in in your browsers after installation. Ubuntu >= 12.04 Java 11
When logging in Rails, you can use the log_tags configuration option to add extra information to each line, like...
Spreewald's patiently repeats the given block again and again until it either passes or times out.
When using the asset pipeline your assets (images, javascripts, stylesheets, fonts) live in folders inside app: app/assets/fonts app/assets/images...
...switches to the clicked link. In a Jasmine spec I wanted to test this behaviour. Unpoly's up.hello emits an up:fragment:inserted event, in whose callback function I can...
...export_path = Dir.mktmpdir('exports') # ... ensure FileUtils.remove_entry(export_path) end Option 3: Using a before/after block before { @export_path = Dir.mktmpdir('exports') } after do if @export_path.present? FileUtils.remove_entry(@export_path)
On some of our older projects, we use the mysql2 gem. Unfortunately, versions 0.2.x (required for Rails 2.3) and...
If you need to run a program on a remote machine (e.g. to your office PC) with a graphical UI...
This is an awesome gadget in your toolbox, even if your test coverage is great. gem install ruby-debug (Ruby...
Inspired by recent "git shortcut" cards I figured it would be nice to have one of these for rebasing a...
When flagging a spec that will be implemented later as pending, include a failing spec body or RSpec 3 will...
...what "memoize" in earlier rails versions did. There is a gem that reintroduces this behavior, but this is the essential implementation. Remember In the above example, some_expensive_calculation is...
...it will be fixed, I guess it will be for Rails 4 only. The best workaround right now is to lock your version of rack at version...
...remember to nilify it afterwards. Otherwise other examples will see your global changes. A better way is to use the .with_power method to change the current power for the...
...to name any file @imported by SASS with a leading underscore. SASS files not beginning with an underscore will be rendered on their own, which will fail if they are...
ImageMagick can automatically crop surrounding transparent pixels from an image: convert input.png -trim +repage output.png
When deploying code with Capistrano (depending on your configuration) at some point Capistrano tries to check out code from your...
Cookies without an expiration timestamp are called "session cookies". [1] They should only be kept until the end of the...