mirror of
https://github.com/drapergem/draper
synced 2023-03-27 23:21:17 -04:00
fix module_namespacing
This commit is contained in:
parent
5182fce273
commit
1393cf2200
2 changed files with 14 additions and 2 deletions
|
@ -23,6 +23,14 @@ module Rails
|
|||
"Draper::Decorator"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
# Rails 3.0.X compatibility, stolen from https://github.com/jnunemaker/mongomapper/pull/385/files#L1R32
|
||||
unless methods.include?(:module_namespacing)
|
||||
def module_namespacing(&block)
|
||||
yield if block
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<% module_namespacing do -%>
|
||||
<%- module_namespacing do -%>
|
||||
<%- if parent_class_name.present? -%>
|
||||
class <%= class_name %>Decorator < <%= parent_class_name %>
|
||||
<%- else -%>
|
||||
class <%= class_name %>
|
||||
<%- end -%>
|
||||
|
||||
# Accessing Helpers
|
||||
# You can access any helper via a proxy
|
||||
|
|
Loading…
Reference in a new issue