This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul id="members" data-role="listview" data-filter="true"> | |
<!-- ... more list items ... --> | |
<li> | |
<a href="detail.html?id=10"> | |
<h3>John Resig</h3> | |
<p><strong>jQuery Core Lead</strong></p> | |
<p>Boston, United States</p> | |
</a> | |
</li> | |
<!-- ... more list items ... --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# put in config/application.rb | |
config.to_prepare do | |
::PagesController.module_eval do | |
caches_page :show, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
caches_page :home, :unless => proc {|c| c.user_signed_in? || c.flash.any? } | |
end | |
::Page.module_eval do | |
after_save :clear_static_caching! | |
after_destroy :clear_static_caching! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rendering a custom plugin | |
<% content_for :page_title do %> | |
<%= @destination.title %> | |
<% end %> | |
<% content_for :page_body do %> | |
<section> | |
<h1>Choose from our most popular recommended itineraries below</h1> | |
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage example: | |
# | |
# Main.register Sinatra::UserAgentHelpers | |
# | |
# -# haml | |
# %body{class: browser.body_class} | |
# | |
# - if browser.ios? | |
# %script{:language => 'text/javascript', :src => '/js/jqtouch.js'} | |
# %p Download our mobile app in the iTunes store! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Implements the world-famous Paul Irish IE conditional comments HTML tag--in HAML. | |
# http://paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ | |
class Main | |
helpers do | |
def cc_html(options={}, &blk) | |
attrs = options.map { |(k, v)| " #{h k}='#{h v}'" }.join('') | |
[ "<!--[if lt IE 7 ]> <html#{attrs} class='ie6'> <![endif]-->", | |
"<!--[if IE 7 ]> <html#{attrs} class='ie7'> <![endif]-->", | |
"<!--[if IE 8 ]> <html#{attrs} class='ie8'> <![endif]-->", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# How to re-use the menu partial for a submenu in Refinery CMS >= 0.9.8.5 and < 0.9.9.22 | |
# header menu (main menu) which hides its children. | |
<%= render :partial => "/shared/menu", | |
:locals => { | |
:dom_id => 'menu', | |
:css => 'menu', | |
:collection => @menu_pages, | |
:hide_children => true | |
} -%> |