...browser must load via a separate request. While this transformation minimizes the amount of JavaScript transmitted, it may also cause your initial bundle to be split into multiple files, which...
...Repeating header on every page Repeating footer on every page You can actually execute JavaScript before the page is rendered to PDF, and implement things like page numbers in the...
...is already at the right position replace: { # You can pass custom data to your JavaScript this way custom: { :foo => 'bar', }.to_json } Both files are independent DOM trees and share...
...If you want auto-sizing inputs in those browsers, you still need a JavaScript solution. Suggested usage I suggest using a small JavaScript library like autosize for browsers that do...
} Note how we check for field-sizing support in both our CSS and JavaScript. We want neither solution to affect the other. Note Unlike field-sizing, any JavaScript auto...
...a simple tag in your HTML, or by instantiating a new Audio object from Javascript. No additional libraries are required, although browser implementations are so bad you will probably want...
...will be broken for VBR MP3s in Flash mode). The libraries usually have a Javascript API that is nicer than the ones provided by the browser and plain Flash, and...
...forked MovieDB should already include a feature that uses a real browser. Add the @javascript tag to your other features to test it yourself. When you run your cucumber feature...
Fixing flaky integration tests (also watch the video on YouTube) What does the @javascript tag do and how does it work? We used to use Selenium with Firefox, but...
Webpacker uses Babel and Webpack to transpile modern JavaScript down to EcmaScript 5. Depending on what browser a project needs to support, the final Webpack output needs to be different...
...E.g. when we need to support IE11 we can rely on fewer JavaScript features. Hence our output will be more verbose than when we only need support modern browsers.
Object#presence Libraries The best way to learn about a Ruby gem, Javascript libary, etc. is often to find the repository on Github and look at its README...
...with their documentation, e.g.: http://unpoly.com https://lodash.com/ https://fontawesome.com/icons Web Platform (HTML, JavaScript, CSS) The best reference to look up information on HTML tags, JavaScript features or CSS...
...why a dialog is shown is somewhat fucked up. It often happens like this: @javascript Scenario: First scenario When I am on a page And I trigger an AJAX request...
...that shows an alert in case of an error @javascript Scenario: Second scenario When I am on another page If your PC is fast enough, the "When I am on...
New guides The documentation has been extended with new guides: Enhancing elements with JavaScript teaches everything you need to know about compilers, destructors and preventing memory leaks. Submitting forms...
...in-place shows how to have Unpoly handle forms from HTML or JavaScript. Notification flashes now contains guidance for suppressing flashes in cached responses. Submit buttons can override form attributes...
...parallel_tests can be run CI and also supports splitting by runtimes Changes in JavaScript and CSS lead to insuficient mapping to features, even though template support has been enabled...
...to Coverage. This gives a benefit because changes in JavaScript often correlate with changes in HTML. This may partly also be influenced by the fact that features are harder to...
To ensure a consistent code style for JavaScript code, we use ESLint. The workflow is similar to integrating rubocop for Ruby code. 1. Adding the gem to an existing...
...and configure specific rules You can use comments to disable specific rules in your JavaScript code.. Or you could use your own configuration for specific rules, like: rules: { '@stylistic/comma-dangle...
...Add <%= csrf_meta_tag %> into your layout's head Put this into a JavaScript file that is always loaded (like your application.js -- or another file you add to the javascript...
Add <%= csrf_meta_tag %> into your layout's head Put this into a JavaScript file that is always loaded (like your application.js -- or another file you add to the...
...producing one more showtime form. Implementation hint Render a single blank showtime form. A JavaScript component finds the blank form and hides it as a template for future showtimes.
Component reuse Package the Add showtime functionality as a generic JavaScript component so we can reuse it in other nested forms. For this to work the...
...example is storing a transition duration as CSS custom property to read it from Javascript. By converting the value like this, you can ensure your Javascript will always get milliseconds...
...a package functionality from window e.g. $(...).datepicker() from your dev console or any other javascript within the application. Background By default yarn will create a folder node_modules that includes...
...to window, to have access to jQuery from our dev console or any other javascript within the application. app/webpack/packs/main.js window.$ = jQuery window.jQuery = jQuery Now this will not allow us to...
(@foo or @bar) So you need to replace a hook like this: AfterStep('~@javascript') do ... end With this: AfterStep('not @javascript') do ... end Also grep your entire project for...
DirectUpload allows you to upload files to your file storage without having to wait for the form to submit. It...
...test runner supports mocking a module's dependencies. This has some drawbacks for frontend JavaScript that targets the browser: Jest only runs in Node.js. This means your specs can no...
not matched Info As of 2024, possessive quantifiers are not supported in JavaScript. There's a TC 39 proposal that's stuck in stage...
...a same_site option, i.e. cookies[:my_cookie] = { value: 'my-value', same_site: 'None' } Javascript (using js-cookie) Make sure you're using at least 2.2.0. Set a cookie with...
...contributions to the gem dist/ usually contains files rendered ready for "distribution", e.g. minified Javascript files src/ usually contains the raw "source" files, e.g. split up into many files, before...
...assets that we don't need allow_any_instance_of(ActionView::Base).to receive(:javascript_include_tag).and_return('script') allow_any_instance_of(ActionView::Base).to receive(:stylesheet_link...
...will have two CSRF tokens: A in the . This is required so client-side JavaScripts may make POST, PATCH, DELETE requests. An within each form. Since Rails 5 this token...
...you can use most ES6 features without a build step. Just deliver your plain JavaScript without transpilation through Babel or TypeScript, and modern browsers will run them natively. Features supported...
...Rails with the assets pipeline (sprockets) you are probably using Uglifier to minify your JavaScript. Uglifier can minify some, but not all ES6 language features. Check if you're affected...
...lambda do |request| (request.session.id || SecureRandom.base64(16)).to_s end Then, find all occurences of javascript_include_tag, javascript_tag, javascript_pack_tag etc. and add nonce: true. Also, make sure...
...don't have any other inline scripts in your application that do not use javascript_tag. Why this works The main point of this CSP is to disallow user content...