-
Notifications
You must be signed in to change notification settings - Fork 20
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
Custom policies for missing components #115
Comments
I don't think it should be called |
So there'd be a magic method on Curly::Presenter that would handle missing components? # curly/presenter.rb
def component_missing(name, identifier, attributes = {})
# Default implementation is to raise an exception:
raise ...
# If you return a string it'll be inserted.
end Individual presenter classes can then enforce their own policy. I'm still not 100% sure on this. How about |
If you equate components with methods, then ideally, it should return true; if you redefine Evem if you don't equate the two, I would say it should return true, because the question is if it's a valid tag, which is independent of it being defined. |
There's already |
Curly could have a option to not throw a error, a idea is to behave like i18n, i did a work around this:
The text was updated successfully, but these errors were encountered: