-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow introspecting a presenter #105
Comments
+1 one on this, it would be also nice to have a option to not throw an exception when curly can't parse a tag, only display a html error, the same way i18n does |
@yurifrl that can be tricky, as Curly is statically typed :-/ |
@dasch doing so could lead to an alternative feature: if a tag couldn't be found, pass it on to a method that acts kind of like |
+1 for @medcat suggestion |
maybe something like that, when curly can't find a tag it renders a custom_error method module Curly
ComponentCompiler.class_eval do
def initialize(presenter_class, component, type: nil)
unless presenter_class.component_available?(component.name)
component = Curly::Parser::Component.new('custom_error', nil, {'tag' => 'custom_error'})
end
@presenter_class, @component, @type = presenter_class, component, type
end
end
end |
If it doesn't exist however, it should still error with the original tag. |
my custom_error: def custom_error(tag: nil)
"####{tag}###"
end |
Can you guys open a separate issue for that? |
It would be great to get a description of a presenter, including all nested presenters.
The text was updated successfully, but these errors were encountered: