...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...
...with the width and the div should only have the height of the picture. html: css: .outer { width: 100%; background-image: image-url('background.png'); background-size: cover; } .inner {
...you only depend on the width of the viewport, you can also use vw: html: css: .background-sizer { width: 100%; height: 60vw; background-image: image-url('background.png'); background-size: cover...
...with isolate scopes have three different variable binding strategies, of which one is =. Example: # HTML # Coffeescript @app.directive 'panel', -> scope: evaluated: '=value' bound: '=twoway' link: -> scope.evaluated # = false scope.bound = 'foo' # Updates parent.someProperty...
...HTML attributes bound with = (value, twoway) have their value evaluated as Angular expression in the parent scope's context and have the result assigned to the corresponding scope variable (evaluated...
In order to keep the controllers directory tidy, we recently started to namespace controllers. With the :controller option you can...
The step definition below allows you to write: Then I should see an HTML redirect to "http://www.makandracards.com" in the page head Capybara Then /^I should see an HTML redirect...
...public contract path in the mailer view: Plain text email URI.join(root_url, @user.contract.url) HTML email link_to('Show contract', URI.join(root_url, @user.contract.url).to_s) Note: You need to...
...Checks if the page or current node has the given text content, ignoring any HTML tags and normalizing whitespace.` (Boolean) has_css?(path, options = {}) Checks if a given CSS selector...
...the page or current node does not have the given text content, ignoring any HTML tags and normalizing whitespace. (Boolean) has_no_css?(path, options = {}) Checks if a given CSS...
db/schema.rb db/structure.sql public/system .project .idea/ public/javascripts/all* public/stylesheets/all* public/stylesheets/*.css config/database.yml *~ *#* .#* .DS_Store webrat-*.html capybara-*.html rerun.txt coverage.data coverage/* dump_for_download.dump .~lock.* .*.swp C:\\nppdf32Log\\debuglog.txt
...option was removed so that in development everything is rendered ugly, too. Problem When HTML is rendered from HAML in production or staging environment, whitespace is removed to reduce the...
...code is is extremely performance-sensitive when you want to operate on an entire HTML document (which is hard to represent as a jQuery collection). To select descendants of a...
...finished re-compiling, you will just reload the same old assets. When you render HTML without a dev server When you don't have a dev server running and call...
...backport the rails 5 new renderer Use case Render pdfs with e.g. pdfkit from html to attach to an email or a model Generate slow reports async
...few) assumptions about your markup and is very customizable. You can basically embed any HTML into the slides, so you can mix images, videos, texts, and other stuff.