Module: Ramaze::Helper::Layout::SingletonMethods
- Defined in:
- lib/ramaze/helper/layout.rb
Instance Method Summary collapse
Instance Method Details
#set_layout(hash_or_the_layout) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/ramaze/helper/layout.rb', line 56 def set_layout(hash_or_the_layout) if hash_or_the_layout.respond_to?(:to_hash) f = hash_or_the_layout.to_hash.find{|k,v| k && v } the_layout = f[0] whitelist = f[1].map{|action| action.to_s } else the_layout = hash_or_the_layout end layout do |path, wish| if whitelist.nil? || whitelist.include?(path.to_s) the_layout end end end |
#set_layout_except(hash_or_the_layout) ⇒ Object
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/ramaze/helper/layout.rb', line 79 def set_layout_except(hash_or_the_layout) if hash_or_the_layout.respond_to?(:to_hash) f = hash_or_the_layout.to_hash.find{|k,v| k && v } the_layout = f[0] blacklist = f[1].map{|action| action.to_s } else the_layout = hash_or_the_layout end layout do |path, wish| if blacklist.nil? || !blacklist.include?(path.to_s) the_layout end end end |