Module: KirguduBase::Models::BasicManagementUrls

Defined in:
app/helpers/kirgudu_base/models/basic_management_urls.rb

Instance Method Summary collapse

Instance Method Details

#portal_delete_urlObject



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'app/helpers/kirgudu_base/models/basic_management_urls.rb', line 65

def portal_delete_url
	allow_delete = true

	if self.class.respond_to?(:action_allowed?)
		allow_delete = self.class.action_allowed?(:delete)
	end

	if allow_delete
		url_options = self.get_parent_ids if self.respond_to?(:get_parents)
		url_options = {} unless url_options && url_options.is_a?(Hash)
		url_options[:controller] = ::ChupakabaraTools::ClassHelper.controller_full_path_underscore(self.class.management_controller)
		url_options[:action] = "destroy"
		url_options[:id] = self.id
		url_options[:only_path] = true

		Rails.application.routes.url_helpers.url_for(url_options)
	end
end

#portal_edit_urlObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/helpers/kirgudu_base/models/basic_management_urls.rb', line 7

def portal_edit_url
	allow_edit = true

	if self.class.respond_to?(:action_allowed?)
		allow_edit = self.class.action_allowed?(:edit)
	end

	if allow_edit
		url_options = self.get_parent_ids if self.respond_to?(:get_parents)
		url_options = {} unless url_options && url_options.is_a?(Hash)
		url_options[:controller] = ::ChupakabaraTools::ClassHelper.controller_full_path_underscore(self.class.management_controller)
		url_options[:action] = "edit"
		url_options[:id] = self.id
		url_options[:only_path] = true

		Rails.application.routes.url_helpers.url_for(url_options)
	end
end

#portal_purge_urlObject



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'app/helpers/kirgudu_base/models/basic_management_urls.rb', line 84

def portal_purge_url
	allow_delete = true

	if self.class.respond_to?(:action_allowed?)
		allow_delete = self.class.action_allowed?(:purge)
	end

	if allow_delete
		url_options = self.get_parent_ids if self.respond_to?(:get_parents)
		url_options = {} unless url_options && url_options.is_a?(Hash)
		url_options[:controller] = ::ChupakabaraTools::ClassHelper.controller_full_path_underscore(self.class.management_controller)
		url_options[:action] = "purge"
		url_options[:id] = self.id
		url_options[:only_path] = true

		Rails.application.routes.url_helpers.url_for(url_options)
	end
end

#portal_show_urlObject



45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'app/helpers/kirgudu_base/models/basic_management_urls.rb', line 45

def portal_show_url

	allow_show = true

	if self.class.respond_to?(:action_allowed?)
		allow_show = self.class.action_allowed?(:show)
	end

	if allow_show
		url_options = self.get_parent_ids if self.respond_to?(:get_parents)
		url_options = {} unless url_options && url_options.is_a?(Hash)
		url_options[:controller] = ::ChupakabaraTools::ClassHelper.controller_full_path_underscore(self.class.management_controller)
		url_options[:action] = "show"
		url_options[:id] = self.id
		url_options[:only_path] = true

		Rails.application.routes.url_helpers.url_for(url_options)
	end
end

#portal_update_urlObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'app/helpers/kirgudu_base/models/basic_management_urls.rb', line 26

def portal_update_url
	allow_edit = true

	if self.class.respond_to?(:action_allowed?)
		allow_edit = self.class.action_allowed?(:edit)
	end

	if allow_edit
		url_options = self.get_parent_ids if self.respond_to?(:get_parents)
		url_options = {} unless url_options && url_options.is_a?(Hash)
		url_options[:controller] = ::ChupakabaraTools::ClassHelper.controller_full_path_underscore(self.class.management_controller)
		url_options[:action] = "update"
		url_options[:id] = self.id
		url_options[:only_path] = true

		Rails.application.routes.url_helpers.url_for(url_options)
	end
end