...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...
...app01-prod: Processing by Users::SessionsController#new as HTML 01 app01-prod: Rendering devise/sessions/new.haml within layouts/signed_out 01 app01-prod: Rendered devise/sessions/new.haml within layouts/signed_out (4.8ms) 01 app01-prod: Rendered layouts/shared/_head.haml...
...they do nearly everything wells, thumbnails, and panels did, only better. Consolidated all our HTML resets into a new module, Reboot. Reboot steps in where Normalize.css stops, giving you more...
...to the of your layout so the feed can be auto-discovered by browsers: %html %head %link{ :href => feed_url, :rel => "alternate", :type => "application/rss+xml", :title => "RSS feed...
jamesgolick / resource_controller at Github module ResourceController module Actions def index load_collection before :index response_for :index end
...from a list. Don't find on elements from a list. Background Consider this HTML: Hello World Lorem ipsum... Hello Universe Lorem ipsum... Now let's say you obtain a...
...if @with_full_urls Note that while this is enough for links in your HTML, it does not affect asset paths like the host enforcement trait does. So it's...
Define a stylesheet for mobile devices Using the media attribute on stylesheet HTML tags allows you to have a CSS for mobile browsers: <%= stylesheet_link_tag 'mobile', :media...
...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...
You know those helper methods that just render some HTML but look weird because of content_tags all over the place? You could also use Haml instead. Example
...following helper. def greeting message = ''.html_safe message << 'Welcome to ' message << content_tag(:span, Rails.env, class: 'greeting--location') content_tag :div, message, class: 'greeting' end That looks clumsy and is...
Clearfix is a hack to clear floating elements without additional HTML markup. If you only need to support IE8 and above, a great clearfix with few side effects is:
...pattern, you can do that. For example, consider a DOM node for the following HTML. We'll reference it by $element below. Option A: Selecting classes, then removing them
...bug that hits me once in a while. It usually occurs in sliders with HTML content. The issue When a slider contains a composited[1] element, the element will overlap...
...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
end paths = lines.compact.sort TextMate::UI.complete(paths, :extra_chars => " ") else %x{ "$DIALOG" tooltip --html 'File /features/support/paths.rb not found.' } end Now you only need some more configuration: Name the command...
...that allows for rendering an element's original content within the directive's template: # HTML Content ... # Directive template # Result Content ... However, if you need more control over the transcludable content...
Installing SSL certificates usually implies additionally using intermediate certificates. If one of them is missing, some SSL client implementations might...
...want to "flash" the details container by hiding it and fading it back in. HTML Add a custom class to the element you want to animate, i.e. the details container...
...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.
...form_for @user, :prefix => 'overlay' do |form| = form.text_field :email and get this as HTML: <input name="user[email]" id="overlay_user_email" (...) /> You can also put a :prefix into...
So you probably see the following error trace within your Passenger log file if you got here:
...at least. This should cover most e-mails. Note that this does not affect HTML e-mails, but they should come with their custom font settings anyway...
#{link_to "label", "url"}! Haml is a great engine for writing shorter, readable HTML. However, there is one thing that troubles me regularly. Consider this Haml code: %p
So you want to find out how many horizontal pixels you have available on a mobile device. This is super...