Sha256: 98224147cc6693fe5312fe990287dcc622fedf4abbff9dd873f8462c4d2ca8f6

Contents?: true

Size: 1.18 KB

Versions: 28

Compression:

Stored size: 1.18 KB

Contents

ActiveRecord::Base.class_eval { include ActiveRecord::Acts::MuckContent }
ActiveRecord::Base.class_eval { include ActiveRecord::Acts::MuckContentPermission }
ActiveRecord::Base.class_eval { include ActiveRecord::Acts::MuckContentTranslation }
ActionController::Base.class_eval { include ActionController::Acts::MuckContentHandler }

ActionController::Base.send :helper, MuckContentsHelper
ActionController::Base.send :helper, TinymceHelper

I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'locales', '*.{rb,yml}') ]

module MuckContents

  GLOBAL_SCOPE = '/'

  class << self
  
    def routes
      content_routes = []
      contents = Content.no_contentable.find(:all, :include => 'slugs')
      contents.each do |content|
        content_route = { :uri => content.uri,
                          :scope => content.scope,
                          :id => content.id }
        if !content_routes.include?(content_route)
          content_routes << content_route
        end
      end
      content_routes
    end
  
    def build_route_options(route)
      options = { :controller => 'contents', :action => 'show', :id => route[:id], :scope => route[:scope] }
      options
    end
  
  end
  
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
muck-contents-0.2.27 lib/muck_contents.rb
muck-contents-0.2.26 lib/muck_contents.rb
muck-contents-0.2.25 lib/muck_contents.rb
muck-contents-0.2.24 lib/muck_contents.rb
muck-contents-0.2.23 lib/muck_contents.rb
muck-contents-0.2.22 lib/muck_contents.rb
muck-contents-0.2.21 lib/muck_contents.rb
muck-contents-0.2.20 lib/muck_contents.rb
muck-contents-0.2.18 lib/muck_contents.rb
muck-contents-0.2.17 lib/muck_contents.rb
muck-contents-0.2.16 lib/muck_contents.rb
muck-contents-0.2.15 lib/muck_contents.rb
muck-contents-0.2.14 lib/muck_contents.rb
muck-contents-0.2.13 lib/muck_contents.rb
muck-contents-0.2.12 lib/muck_contents.rb
muck-contents-0.2.11 lib/muck_contents.rb
muck-contents-0.2.10 lib/muck_contents.rb
muck-contents-0.2.9 lib/muck_contents.rb
muck-contents-0.2.8 lib/muck_contents.rb
muck-contents-0.2.7 lib/muck_contents.rb