Skip to content

Cannot use decorator methods in decorator #107

@wenbo

Description

@wenbo

It's okay to use decorator methods in actionview,
but just like the following case, if I use decorator method in other decorator, it will be confronted with error.

it will be wonderful if it's possible to use decorator methods in decorator. that's the feature that needed in my situation.
Any ideas please.

module ClassADecorator
  def mtd_a
    "this is mtd a"
  end
end

module ClassBDecorator
  def mtd_b
    # error, undefined method `mtd_a' for #<ClassA>
    ClassA.new.mtd_a 
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions