Skip to content

Instantly share code, notes, and snippets.

@dbryand
Created March 8, 2010 20:19
Show Gist options
  • Save dbryand/325615 to your computer and use it in GitHub Desktop.
Save dbryand/325615 to your computer and use it in GitHub Desktop.
Browsercms monkey patch to allow "uncountable" named content blocks
require 'cms/path_helper'
module Cms
module PathHelper
def cms_index_path_for(resource, options={})
options[:only_path] = false
cms_index_url_for(resource, options)
end
def cms_index_url_for(resource, options={})
options[:controller] ="cms/#{resource_collection_name(resource).pluralize}"
options[:action] = "index"
url_for(options)
end
def cms_new_path_for(resource, options={})
options[:only_path] = false
cms_new_url_for(resource, options)
end
def cms_new_url_for(resource, options={})
options[:controller] ="cms/#{resource_collection_name(resource).pluralize}"
options[:action] = "new"
url_for(options)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment