RackTest RackTest is a simple browser simulator that is just aware of plain HTML represented as a string (HTTP response body). It does not evaluate CSS or JavaScript. It...
Having a unique selector for an element is useful to later select it from JavaScript or to update a fragment...
...of time in the long run. It will also instantly reload changes to your html views. Simply follow the instructions below, taken from blog.55minutes.com. Install CSS live reload (only once...
New versions of wkhtmltopdf dissallow file:// URLs by default. You can allow them by passing --enable-local-file-access.
If you get an error like this: Unable to launch /home/bruce/Projects/myproject/tmp/capybara/capybara-201110311210111407691101.html ... update your launchy gem. It failed for us in...
This might eventually be fixed by Rails itself.\ Right now this is the way to have the rails_xss plugin...
...iPhone|iPad|Windows Phone|Opera Mobi|Kindle|BackBerry|PlayBook)\b/i end In your layout: %html %body{ :class => 'touch_device' => ('true' if touch_device?)} In your application.js: var TouchDevice = (function() {
You most likely have a form element inside another form element. Don't do that. Ever. Firefox and Chrome will...
Consider this HTML: Click me! Hello Universe! Hello Universe! Hello Universe! Hello Universe! Hello Universe! Hello Universe! If you want the actions element to float on the left, you'd...
Calling #gsub on a string that was previously marked as #html_safe will lead to unexpected behavior. E. g. backreferences to captured groups ($1, $2) will be nil even if...
...group was matched. There is no universal workaround available since you can't expect #html_safe strings to still be safe after using gsub on them. You can, however, fix...
...align a div box inside a div container. This is how you do it: HTML Some text... in two lines. CSS Set the line-height to the container's (implicit...
...Debug a Function Pause Execution on URL Change Debugging Property Reads Use copy() Debugging HTML/CSS
...do it (also try this jsfiddle). The children need to be block elements. The HTML ... The CSS .parent { display: table-cell; vertical-align: middle; width: 500px; height: 300px; } .child {}
Ruby bindings for Sundown, a fast and full-featured Markdown parser that lets you define renders for arbitrary output formats...
It is common in Rails 3.0 applications that you want to provide default views for a group of controllers. Let...
Download the dictionary from http://www.winedt.org/dict.html, e.g. http://www.winedt.org/dict/de_neu.zip unzip de_neu.zip mkdir ~/Documents/dic iconv -f UTF-16 -t...
...the case, you can omit this part. */ .absoluteCenter { max-height: 100%; max-width: 100%; } HTML Paragraph goes here...
How you order elements in the can have an effect on the (perceived) performance of the page. This script helps...
Sometimes you want to run a command forever, e.g. to compile a haml to html file on the console. Use this: $ while(true) do haml index.haml index.html; sleep 1.5; done
...capture will receive the String result from the block instead of the buffer. All html_safe? information on it is lost! A possible fix for capture Admittedly, you'll rarely...
Redactor is yet another WYSIWYG editor. It definitely has its weak points, but I want to point out that it...
Modern versions of Capybara include a finder method #ancestor which allows you to find a parental element using CSS or...
So I had the issue that User input (coming from many different sources and users) often contains the...
If you render markdown from user input, an attacker might be able to use this to inject javascript code into...