Page Caching With Page Caching the rendered source code will be saved as html file. When a user has a cache hit for the requested page, the html file...
...action => 'index', :action_suffix => 'all_jobs') do %> <%= do_some_render_intensive_stuff %> <% end %> Other html stuff If there is only one fragment to cache you can call the cache method...
...forget dropdown submenus!). After upgrading to Bootstrap 4 you only have to adapt the html to its new structure will_paginate-bootstrap won't work with Bootstrap 4 Suggestion: Replace...
...the image's cache name to the client render json: uploader.cache_name end end HTML In the gallery form, we'll need a template for adding new images. I chose...
...to add a blank record for this purpose. # app/views/galleries/_form.html.haml = form_for @gallery, html: { 'gallery-form': true } do |gallery_form| .form-group = gallery_form.label :name = gallery_form.text_field :name %label Images %table - template...
...you can use that as well, though it has no extra benefit: :001 > Nokogiri::HTML("This is beautiful markup ").text.gsub(/[^[:word:]]+/, " ") => "This is beautiful markup" DANGER, WILL ROBINSON: Both solution...
:001 > ActionController::Base.helpers.strip_tags("<<<<YY<>>NASTY><s<<>s>") => "<<<<>>NASTY><<>s>" :002 > Nokogiri::HTML("<<<<YY<>>NASTY><s<<>s>").text => ">NASTY>s>" :003 > ActionController::Base.helpers.strip_tags("<<<<YY<>>NASTY><s<<>s...
...The first one is done, which only exists in jQuery: $.ajax('/foo').done(function(html) { console.debug("The server responded with %s", html); }); There is also then, which all promise libraries...
$.ajax('/foo').then(function(html) { console.debug("The server responded with %s", html); }); However, .done() and .then() do not behave the same. In particular, if a standard promise callback returns...
...idea behind GTM The "tag" in "Google Tag Manager" has nothing to do with HTML tags, nor with word tags or tag clouds. In the ecommerce world, a tag is...
...DOM changes" if you want to track images inside a lightbox. Tags The "Custom HTML" tag injects arbitrary HTML into the page. Use to inject Javascript. Useful for e.g. defining...
...is a great enhancement when you want users to supply some kind of code (HTML, JavaScript, Ruby, etc). It offers syntax highlighting and some neat features like auto-indenting.
...Unpoly compiler that will improve your : import ace from 'brace' import 'brace/mode/html' import 'brace/theme/monokai' up.compiler('[html-editor]', ($element) => { let $editorContainer = $(' ').insertAfter($element) let editor = ace.edit($editorContainer.get(0)) let session = editor.getSession...
...it with your mail client. See also Litmus, a "Browserstack for mail clients" Designing HTML Emails
...breaking to force it appear) that would usually separate them. We're trimming the HTML of the element that should not be truncated so that we don't end up...
...a property of the isolate scope to a function in the parent scope. Example: # HTML # Coffeescript @app.directive 'panel', -> scope: parentFn: '&proxy' link: (scope) -> scope.parentFn(arg1: 'first', arg2: 'second')
...know the arguments to pass to that function? Defining plain function arguments in the HTML Luckily Angular supports plain values in the proxy definition in the HTML, and even a...
...container as tall as its content needs to be, but not taller. Example Your HTML needs to be structured like so: Your content goes here. Note that your foldable element...
...file to the asset pipeline. Require it in your application.js: #= require clipboard Prepare your html: Your copy-to-clipboard-button either needs a data-clipboard-target attribute with a selector...
...tooltip(title: tooltipText()) .tooltip('show') .on 'hidden.bs.tooltip', -> $button.tooltip('destroy') tooltipText = -> text = "" if isOnMacOS() language = $('html').attr('lang') text = if language == 'de' '⌘-C zum Kopieren drücken' else 'Press ⌘-C to copy...
...values of each call will be joined and returned. You may of course render HTML inside the block: # _fields.html.haml = form.collection_check_boxes :author_ids, Author.all, :id, :name_with_initial do...
...which DOM API methods are being called: element.querySelectorAll(':scope > .your-selector') Example Consider this HTML foo bar baz Hello Universe without :scope A simple document.body.querySelectorAll('div') will return a NodeList...
...site requesting silly formats like: http://www.rails-app.com/makandra.html-username-2000 # => Rails tries to retrieve 'makandra' with format 'html-username-2000' Just restrict accepted format parameters for the whole application like this:
before_filter :refuse_silly_formats private def refuse_silly_formats acceptable_formats = %w[html xml pdf] if params[:format] unless acceptable_formats.include? params[:format].downcase Rails.logger.error "Format not supported: #{params...
...a profile for each of them. In this case you can use a vanilla HTML link to a prefilled "share" form on Twitter, Google+ and Facebook. Use the URL templates...
...fill out a short form and get a Javascript snippet to copy/paste into your HTML: Facebook like button Google +1 button Twitter buttons Unfortunately just having the untuned buttons sit...
...text snippet for Cucumber: When /^I fill in the "([^\"]+)" WYSIWYG editor with:$/ do |selector, html| patiently do page.execute_script("return isCkeditorLoaded('#{selector}');").should be_true end html.gsub!(/\n+/, "") # otherwise: unterminated...
...string literal (Selenium::WebDriver::Error::JavascriptError) page.execute_script("CKEDITOR.instances['#{selector}'].setData('#{html}');") end The snippet for JavaScript: function isCkeditorLoaded(instance_selector) { // instance_selector is e.g. 'template_html' var status;
.../while proxying, the proxied app will probably be broken: all absolute paths in your HTML's link hrefs point to the wrong URL any CSS that contains directives like background...
...Content_Type} =~ m|^application/javascript|" FilterChain NEWPATHS Note that code above isn't aware of HTML or CSS in any way, it does a brute find-and-replace. You can now...
...explains and visualizes the intricacies of CSS's vertical-align. Some take-aways Each HTML element is actually a stack of line-boxes. If you know the height of each...
...your Javascript. Or you can have an ERB template which generates Haml which generates HTML. You can chain as many preprocessors as you want. When you deploy, Rails runs assets...
Consider this HTML: Even though the surrounding container defines a line-height, which vertically centers its inline elements, the check box will be top aligned if it is the only...
...element inside the container. It will be aligned correctly if the HTML looks like this: foo Complex explanation here. So the actual fix is to add some inline elements next...
...else -- your IDE may even be aware of it, for example RubyMine understands <<-SQL, <<-HTML, <<-XML, <<-JSON, etc and highlights correctly. Please note: Your string will end with a new...
...you can just put your heredocs strings below each other. Example: def long_messages html_escape(<<-ONE) + ' ' + html_escape(<<-TWO) Here goes my first very long message. Yeehaw! ONE
...executed after the DOM has loaded completely. That means when the browser has finished HTML parsing and built the DOM tree. At that time, you can manipualte the DOM although...
...though the element(s) you would like to manipulate exist(s) in the delivered HTML. So you should always encapsulate DOM-manipulating javascript code in a DOM-loaded callback.
SiteDomain="yourdomain.de" DirData="." DNSLookup=0 Run the following to build a simple HTML page: awstats -staticlinks -config="yourdomain.de" -LogFile=your-logfile.log -output > report.html This might take a second (it...