Skip to content

Instantly share code, notes, and snippets.

View parndt's full-sized avatar

Philip Arndt parndt

View GitHub Profile
Page ------------> Page Part
as is
+ master_page_id
+ locale
Page has many Page
def url(geometry = nil)
unless ::Refinery.s3_backend
if geometry.present?
"#{self.image.thumb(geometry).url}#{self.image_uid.split('/').last}"
else
(self.image.url.split('/')[0..-2] | [self.image_uid]).join('/')
end
else
geometry.present? ? self.image.thumb(geometry).url : self.image.url
end
# 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
} -%>
$ gem update engineyard
Updating installed gems
Updating engineyard
Successfully installed engineyard-serverside-adapter-1.3.3
Successfully installed engineyard-1.3.1
Gems updated: engineyard-serverside-adapter, engineyard
Installing ri documentation for engineyard-serverside-adapter-1.3.3...
Installing ri documentation for engineyard-1.3.1...
Installing RDoc documentation for engineyard-serverside-adapter-1.3.3...
Installing RDoc documentation for engineyard-1.3.1...
#!/usr/bin/env ruby
require 'rubygems'
require 'socket'
require 'octopi'
include Octopi
COMPETITORS = {
'refinery' => "resolve/refinerycms",
'radiant' => "radiant/radiant",
@parndt
parndt / gist:648205
Created October 27, 2010 01:16
Default Gemfile in Refinery CMS 0.9.8.5 generated app
source 'http://rubygems.org'
gem 'rails', '3.0.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', :require => 'sqlite3'
# Use unicorn as the web server
# Absurd. Who else sees things like this? Why is it loading them twice?
Slug Load (0.4ms) SELECT "slugs".* FROM "slugs" WHERE ("slugs"."sluggable_id" IN (2,1,3,11,4,5,6,7,8,9,10) and "slugs"."sluggable_type" = 'TripGroup') ORDER BY id DESC
Slug Load (0.1ms) SELECT "slugs".* FROM "slugs" WHERE ("slugs".sluggable_id = 2 AND "slugs".sluggable_type = 'TripGroup') ORDER BY id DESC LIMIT 1
Slug Load (0.1ms) SELECT "slugs".* FROM "slugs" WHERE ("slugs".sluggable_id = 1 AND "slugs".sluggable_type = 'TripGroup') ORDER BY id DESC LIMIT 1
Slug Load (0.1ms) SELECT "slugs".* FROM "slugs" WHERE ("slugs".sluggable_id = 3 AND "slugs".sluggable_type = 'TripGroup') ORDER BY id DESC LIMIT 1
Slug Load (0.1ms) SELECT "slugs".* FROM "slugs" WHERE ("slugs".sluggable_id = 11 AND "slugs".sluggable_type = 'TripGroup') ORDER BY id DESC LIMIT 1
Slug Load (0.1ms) SELECT "slugs".* FROM "slugs" WHERE ("slugs".sluggable_id = 4 AND "slugs".sluggable_type = 'TripGroup') ORDER BY id DESC LIMIT 1
Slug Load (0.1ms) SELECT "sl
// This is why we moved from prototype to jQuery
FastInit.addOnLoad(function()
{
$$('#body_content_left_content', '#body_content_right_content').each(function(content){
// it's okay if the first and last descendant are the same
descendants = content.descendants().select(function(d){return d.tagName == "P"})
if ((first_descendant = descendants.first()) != null) { first_descendant.addClassName('first_paragraph'); }
if ((last_descendant = descendants.last()) != null) { last_descendant.addClassName('last_paragraph'); }
});
When running Dragonfly's features using rails 3.0.2 specified in the Gemfile.
*** RUNNING FEATURES IN THE RAILS APP... ***
Using the default profile...
..F----
(::) failed steps (::)
Dragonfly::TempObject must be initialized with a String, a File, a Tempfile, or another TempObject (ArgumentError)
/code/dragonfly/lib/dragonfly/temp_object.rb:179:in `initialize_from_object!'
<% children = @page.root.children.map {|child| (child.in_menu?) ? child : nil}
if children.any?
unless defined?(selected_item)
selected_item = collection.detect{|page| selected_page?(page)}
selected_item = @page if selected_item.nil?
end
sibling_count = children.size - 1
-%>
<ul id="submenu"><%= render :partial => "/shared/submenu_branch", :collection => children, :locals => {
:hide_children => hide_children,