Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I reference dynamic attributes inside of other dynamic attributes? #447

Open
benlieb opened this issue Nov 5, 2019 · 1 comment

Comments

@benlieb
Copy link

benlieb commented Nov 5, 2019

The following fails with undefined method 'person_path'

  attribute :person_path do |obj|
    url_helpers.person_path obj 
  end

  attribute :edit_person_path do |obj|
    "#{obj.person_path}/edit/person"
  end
@esambo
Copy link

esambo commented Feb 19, 2021

Extracting it to a class method might help: #344 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants