app/helpers/roroacms/general_helper.rb in roroacms-0.0.6.7 vs app/helpers/roroacms/general_helper.rb in roroacms-0.0.6.8
- old
+ new
@@ -71,22 +71,10 @@
end
change ? hash : nil
end
- # list controllers in given directory
- # Params:
- # +dir+:: directory that you want to list all of the controllers from
-
- def list_controllers_raw(dir = "")
- dir = dir + "/**/" if !dir.blank?
- controller_list = Array.new
- Dir["#{Roroacms::Engine.root}/app/controllers**/roroacms/#{dir}*.rb"].each do |file|
- controller_list.push(file.split('/').last.sub!("_controller.rb",""))
- end
- end
-
# capitalizes all words in a string
# Params:
# +str+:: the string
def ucwords(str = nil)
@@ -112,18 +100,11 @@
# Params:
# +url+:: the URL that you want to strip down
def strip_url(url)
- return url if url.blank?
-
- url.sub!(/www./, '') if url.include? "www."
+ Setting.strip_url(url)
- url.sub!(/https\:\/\//, '') if url.include? "https://"
-
- url.sub!(/http\:\/\//, '') if url.include? "http://"
-
- return url
end
# reutrns a nested menu
# Params:
# +item+:: hash of menu items
\ No newline at end of file