Sha256: 5685976becc5f389ebea6482cbd82ff9db1e781160ee9df27c1aea83355b2108

Contents?: true

Size: 2 KB

Versions: 1

Compression:

Stored size: 2 KB

Contents

# -*- encoding : utf-8 -*-



module KirguduBase

	class FacadeController < ::KirguduBase::ApplicationController

		#before_filter :authenticate_user

		layout "/layouts/application"



		def left_menu_path
			"/admin/kirgudu_base/left_menu"
		end

		def current_entry
			@entry
		end


		include GuiHelper


		def create_breadcrumbs

			#if @current_user.user_at_portals.count > 1
			#add_new_breadcrumb I18n.t("select_portal.index.title"), url_for(controller: ::ErpZone::SelectPortalController.to_route_path, action: :index)
			#end

			#add_new_breadcrumb @current_portal.name, url_for(controller: ::AdminZone::DashboarController.to_route_path) if @current_portal
			#
			#
			#if self.class.to_s == ::AdminZone::DashboardController
			#	add_new_breadcrumb(I18n.t("#{self.to_i18n}.index.title"))
			#	return
			#end

			#if self.action_name == "index"
			#	add_new_breadcrumb(I18n.t("#{self.to_i18n}.index.title"))
			#else
			#	add_new_breadcrumb(
			#		I18n.t("#{self.to_i18n}.index.title"),
			#		url_for(controller: ::ChupakabraTools::ClassHelper.controller_underscore(self), action: "index", id: @container))
			#
			#	if ['new', 'create'].include?(self.action_name)
			#		add_new_breadcrumb(I18n.t("#{self.to_i18n}.new.title"))
			#	elsif ['edit', 'update', 'show'].include?(self.action_name)
			#		entry = self.current_entry
			#
			#		if entry && entry.respond_to?(:name_for_breadcrumbs)
			#			add_new_breadcrumb(entry.name_for_breadcrumbs)
			#		end
			#	end
			#end
		end

		protected

		rescue_from ActiveRecord::RecordNotFound do
			flash[:error] = I18n.t("#{self.to_i18n}.entry_not_found", entry_id: params[:id])
			respond_to do |format|
				format.html { render_redirect url_for(action: 'index') }
				format.json { render_json_not_found(message: flash[:error]) }
			end
		end

		private

		def before_entry_create(entry, filter_params, options)
			entry.creator = @current_user
			entry.updater = @current_user
		end

		def before_entry_update(entry, filter_params, options)
			entry.updater = @current_user
		end
	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kirgudu_base-0.0.1 app/controllers/kirgudu_base/facade_controller.rb