...HTML. Be it some localized link, or some tags for formatting that you wantto include in your translated text. Example: # e.g. config/locales/en.yml en: page: text: 'Please visit our corporate website...
Our applications not only need to be functional, they need to be fast. But, to quote Donald Knuth, premature optimization...
...your particular development server shows an error. Warning Unpoly cannot repeat form submissions that include file inputs. If it tries, the file data will be replaced with the string [object...
...To avoid confusion, this code will instead redirect to /__better_errors when a file is included in the submission. // Only do this in development. This requires a `[data-environment="development"]` attribute...
4 0 - 5 Dev machines are not blocked on test runs; Code Reviews include test badge; Automatically merge a PR on green tests Upgrade Rails 5 0 - 5
...client: Make a POST request with method override The default configuration Rails and Sinatra includes a Rack middleware that lets you control the HTTP method used for routing by POSTing...
...mail (or even password reset e-mail), or something similar. The e-mail also includes some reflected text. For example, a user may be able to give their name, and...
...is used within the e-mail. The spammer will then abuse that text to include his advertisment. Potential counter measures are: Add a captcha. Rate limit the sign-up or...
...and we need to prepend the class to define class methods. Test class Test; include SuperClient; end Test.foo => 'New foo' Test.new.bar => 'New bar' Good practice If you do monkey patches...
...e.g. all attributes need to be present when initializing an object. Example: class User include ActiveModel::Attributes attribute :salutation attribute :first_name attribute :last_name attribute :street_and_number
...a webkitRelativePath property which lists the relative file path, starting from the selected directory (including it). Example: http://jsfiddle.net/xozvprdj/ Note that Chrome will show a confirmation prompt to make...
...HTML. As a fallback for older browsers you can use name (which won't include any path). See also File System Access API: Recursive Directory Traversal
Add zip_tricks to your Gemfile and bundle install. In your controller, include ZipTricks::RailsStreaming. You can then use the zip_tricks_stream method in controller actions to...
...own Last-Modified or ETag header to achieve that. Example controller: class DocumentsController < ApplicationController include ZipTricks::RailsStreaming def download documents = Document.all fresh_when Time.current # Sets `Last-Modified` header (see above...
...used (in development and tests)' do get 'http://www.example.com/test/set_cookie' response.headers['Set-Cookie'].should include('test=') # Cookie is still set response.headers['Set-Cookie'].should_not include('; Secure') end end
SimpleForm comes with an option browser_validations which could be used to give fields that have a presence validation the...
...also need to override some methods, you can do this: class HelperProxy < ActionView::Base include ApplicationController.master_helper_module def current_user #let helpers act like we're a guest
Bare metal If you have strong nerves, you can also try to include the ApplicationController.master_helper_module directly into your model...
...excludes spaces, control characters, and similar) /[[:lower:]]/ Lowercase alphabetical character /[[:print:]]/ Like [[:graph:]], but includes the space character /[[:punct:]]/ Punctuation character /[[:space:]]/ Whitespace character ([[:blank:]], newline, carriage return, etc.)
...you need to skip those items that are #marked_for_destruction?. Otherwise you will include items that have been ticked for deletion in a nested form. See ActiveRecord: When aggregating...
...pick up and notify you so you can fix it. Note StandardError does not include all error classes. So, while it might seem that rescue without specifying exception classes might...
...you have the following code: module Mod def foo @@foo end end class Klass include Mod end @@foo does not mean Klass::@@foo (qualifier added to make my point; it...
...Ruby expression). It actually means Mod::@@foo and is shared between Mod, all classes including Mod as well as all their subclasses. Also note that only the class and module...
...body with a blank line Limit the subject line to 50 characters (max. 72), include reference (unique story ID) to requirements tracker (Linear in our case) Capitalize the subject line...
...will fail when trying to compile their assets up front. class ApplicationController < ActionController::Base include EsbuildErrorRendering if Rails.env.development? end module ApplicationController::EsbuildErrorRendering ESBUILD_ERROR = Rails.root.join("esbuild_error_#{Rails.env}.txt") # see...
...of the project? Do you have to correct further estimates accordingly? Our estimates always include a percentage markup for organization and project management anywhere between 10% and 30%.
...them like this: *, :before, :after { transition-property: none !important; animation: none !important; } To only include these styles for tests, see Detect the current Rails environment from JavaScript or CSS.
...a list of acceptance criteria and (optionally) some additional notes. The introduction sentence should include the role of the user, what the user wants and why. The acceptance criteria are...
...full UTF-8 space, not just Latin/ASCII. For example, a password policy matcher might include regular expressions like [A-z] or [0-9], but those do not match e.g. German...
...See https://thepugautomatic.com/2013/07/dsom/ module WithModuleInheritance def with_module_inheritance(&block) anonymous_module = Module.new include anonymous_module anonymous_module.module_eval &block end end Module.include(WithModuleInheritance...