Sha256: 95e5dbbb4731d25e97319090ba55ae29410868cc9e869f465a69b642ce418ca8

Contents?: true

Size: 587 Bytes

Versions: 1

Compression:

Stored size: 587 Bytes

Contents

# dynamically do the permalink -> content_part or content_category routing
class Cms::AliasesController < Spree::BaseController
  def show
    
    category = ContentCategory.find_by_permalink(params[:name])
    part = ContentPart.find_by_permalink(params[:name])

    if category
      @contentCategory = category
      @contentParts = @contentCategory.content_parts

      render 'cms/content_categories/show'
		elsif part
      @contentPart = part
      render 'cms/content_parts/show',
		else
		  render :file => "#{RAILS_ROOT}/public/404.html", :status => :not_found
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spree-cms-0.2.1 app/controllers/cms/aliases_controller.rb