-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
Description
It would be great to get a description of a presenter, including all nested presenters.
class OrganizationPresenter < Curly::Presenter
def name; end
def members(max: nil); end
def open?; end
class MemberPresenter < Curly::Presenter
def name; end
def admin?; end
end
end
OrganizationPresenter.description #=>
{
components: [
{
name: "name",
type: "value",
parameters: []
},
{
name: "open?",
type: "conditional",
parameters: []
},
{
name: "members",
type: "collection",
parameters: [ { name: "max", required: false } ],
components: [
{
name: "name",
type: "value",
parameters: []
},
{
name: "admin?",
type: "conditional",
parameters: []
},
]
},
]
}
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
yurifrl commentedon Nov 7, 2014
+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
dasch commentedon Nov 7, 2014
@yurifrl that can be tricky, as Curly is statically typed :-/
teliosdev commentedon Nov 8, 2014
@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
method_missing
. I'm not sure if this would be a part of the "curly way," but it could allow for some user extensibility.thelinuxlich commentedon Nov 8, 2014
+1 for @medcat suggestion
yurifrl commentedon Nov 10, 2014
maybe something like that, when curly can't find a tag it renders a custom_error method
teliosdev commentedon Nov 10, 2014
If it doesn't exist however, it should still error with the original tag.
yurifrl commentedon Nov 10, 2014
my custom_error:
dasch commentedon Nov 10, 2014
Can you guys open a separate issue for that?
yurifrl commentedon Nov 10, 2014
#115