Sha256: 0c01feed61b8df8237df0067563bd4e5c4ba5be2573e8eaf81ef0bc09b47cbeb

Contents?: true

Size: 499 Bytes

Versions: 2

Compression:

Stored size: 499 Bytes

Contents

module Binda
	module ComponentControllerHelper
		extend ActiveSupport::Concern

	  def get_components( slug, ask_for_published = true, custom_order = '' )
	  	if ask_for_published && custom_order.blank?
		  	Binda::Structure.friendly.find( slug ).components.published.order('position')
		  elsif custom_order.blank?
		  	Binda::Structure.friendly.find( slug ).components.order('position')
		  else
		  	Binda::Structure.friendly.find( slug ).components.order( custom_order )
		  end
	  end

	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
binda-0.0.6 app/controllers/concerns/binda/component_controller_helper.rb
binda-0.0.5 app/controllers/concerns/binda/component_controller_helper.rb