Sha256: f80c0193b240338c76de9003b2481bfa665e70f12d3760fb890b1f6bae2ab304

Contents?: true

Size: 827 Bytes

Versions: 2

Compression:

Stored size: 827 Bytes

Contents

module Binda
  class ApplicationController < ActionController::Base
    
    protect_from_forgery with: :exception

		before_action :authenticate_user!

		# _ indicates that we are not using the argument in the method
	  def after_sign_in_path_for(_)
	 	  binda.dashboard_path
	  end

		# _ indicates that we are not using the argument in the method
	  def after_sign_out_path_for(_)
	  	root_path
	  end

	  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.3 app/controllers/binda/application_controller.rb
binda-0.0.2 app/controllers/binda/application_controller.rb