Skip to content

Instantly share code, notes, and snippets.

@pbonnell
Created March 28, 2011 19:24
Show Gist options
  • Save pbonnell/891094 to your computer and use it in GitHub Desktop.
Save pbonnell/891094 to your computer and use it in GitHub Desktop.
rake installed initializer for template_wrapper gem
# install me : {Rails.root}/config/initializers/template_wrapper_initializer.rb
if defined?(TemplateWrapper)
## ALL VALUES HERE ARE DEFAULTS IF INITIALIZER IS NOT PRESNT
TemplateWrapper.default_rendering = :full
# :full (icon & text) || :icon (only) || :comment (wraps patial in source comments only) || :blank (do nothing)
TemplateWrapper.image_src = "http://circuitllc.com/template_wrapper/images/ruby_next.png"
# feel free to grab this from the circuit box for local serve, or use whatever you wish...
# => more images :
TemplateWrapper.href = {:link =>"NOT_IMPLEMENTED", :class => 'template_wrapper_link'}
# : link = NOT IMPLEMENTED: currently links to textmate URL :
# => "txmt://open/?url=file://#{@root}/#{path}&line=11&column=2"
TemplateWrapper.wrapper_element = {:element => :span, :class =>'template_wrapper'}
# :element = the element type to wrap the partial in.
# => it can be whatever element type you want, but a non :span might seriously bork your layout
# === SOME CSS TO GET YOU STARTED ====
# .template_wrapper {padding:0px;margin:0px;}
# .template_wrapper:hover {opacity: 0.25;-moz-opacity: 0.25;filter:alpha(opacity=25); }
# a.template_wrapper_link {font-size:10px; color:blue; padding:3px;position: relative;left:0px;top: 0px;}
# a.template_wrapper_link:hover { color: red; font-weight:bold!important; }
# ===================================
else
puts "TemplateWrapper not present. Skipped initializer."
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment