...LIKE only takes a fraction of a second. This means when optimizing a typical Rails action, you should probably look further than the database. A view can easily take many...

stackoverflow.blog

...opensource.zalando.com/restful-api-guidelines https://www.merixstudio.com/blog/best-practices-rest-api-development/ https://www.oreilly.com/library/view/rest-api-design/9781449317904/ More topics in our deck: Rails: Rest API post-mortem analysis InfoQ: How to Design a Good API & Why it Matters

...iconfont-plugin-webpack that automate the font building. If you're still using the Rails asset pipeline, try the half-automatic approach. Webpacker Rails: How to integrate the plugin

...a model Signature with name: string, signature: text, you can use it with regular rails form like this: - form_for @signature, :html => { :class => 'signature_form' } do |form| %dl %dt = form.label...

In Ruby on Rails, all objects have a useful blank? method. It returns true for nil but also for empty strings or empty arrays. There is also a universal method...

...When dealing with geo data, you'd often use acts_as_geocodable for your Rails applications. There you can just use your model's upgraded find to achieve the same...

jqueryui.com

...into position[]=13&position[]=15, which neatly resolves to params[:position] == [13, 15] in Rails. Broken placeholder height When a dragged row does not have a set height but rather...

Obviously, this leads to problems when comparing strings: "Über".downcase == "über" => false In Rails you can use ActiveSupports' multibyte chars to avoid that problem. It gives you a wrapped...

...it really hard to make this work reliably. Also see Dynamically uploading files to Rails with jQuery File Upload...

github.com

...Minidusen, which extracts those parts from Dusen. Minidusen is compatible with MySQL, PostgreSQL and Rails 3.2, 4.2 and 5.0. If you are looking for a full text indexing solution, we...

...to invalidate Cloudfront cached assets, and Cloudfront will ignore the usual ?123456 timestamps that Rails uses by default. So to make sure Cloudfront will not server outdated assets, you have...

...to remember the password, give a form an autocomplete attribute with the value off: ... Rails example form_for @model, :html => { :autocomplete => "off" } do |form...

rubyforge.org

Under certain circumstances gettext_i18n_rails will hit a near-infinite loop. This occured in Rails 2.3.5 with Haml 3.0.18 and fast_gettext 0.5.10. gettext_i18n_rails's Haml-Parser...

This note describes how to kick a user out of a Rails application after she hasn't requested an action for a while. Note that this is different from deleting...

...node version that is older than mine. Every time I wanted to run my rails dev server I was asked to check my yarn integrity: error Integrity check failed

+ "systemParams": "linux-x64-64", "modulesFolders": [ "node_modules" ], - "flags": [], + "flags": [ + "checkFiles" + ], "linkedModules": [], "topLevelPatterns": [ "@rails/webpacker@4.x", There were also changes in node_modules/node-sass/vendor/linux-x64-64/binding.node. After I switched to the "correct...

...sub directories, make sure to add -r features to the standard Cucumber options. In Rails apps, Cucumber options are likely to be stored in config/cucumber.yml...

Here is how to do it without a server-side component (like a Rails application). Use JavaScript's navigator.language (real browsers and IE11+) and navigator.userLanguage (old IEs).

...You can "fix" this in multiple ways: Update your drivers on your machine with RAILS_ENV=test rake webdrivers:chromedriver:update Ignore the driver update-URL in your VCR configuration...

...and see if VCR complains: WD_CACHE_TIME=1 bundle exec cucumber Note: Newer Rails versions come with the webdrivers gem automatically...

We have two redundant auto-failover FreeBSD load balancers for our Ruby on Rails hosting setup that are connected to the Internet backbone with a 10GE interface pipe. All...

...other components are redundant, too. Interested? See http://railscomplete.de

...cleaner will take care of this. See How to set up database_cleaner for Rails with Cucumber and RSpec...

github.com

Good reference how to build bootstrap forms with simple_form.

You installed some gems that install a binary (like bundle, rake or rails) with code that only works with modern Rubygems versions You downgraded Rubygems to an older...

...require 'mathn' call (usually by wrapping Bundler.require) like this: # config/application.rb MathnWorkaround.intercept do Bundler.require(:default, Rails.env) if defined?(Bundler) # If you require "mathn" manually, put it inside this block. end

...to your site and still have the serialization of such objects in their session. Rails will then try to rebuild the user's session and raise an error out of...