Skip to content

Explore adding Fragment objects #57

@jho406

Description

@jho406

Closely related to #56 . This issue is about exploring the idea of adding a Props::Fragment object. Fragments are defined like this:

json.note(
  partial: [
    "club_notes/note",
    fragment: "club_note_#{@club_note.id}",
  ]
) do
# Empty block here
end

But it can be a bit tedious to define across different props templates if they are used elsewhere. I'm considering adding a Props::Fragment object that folks can inherit from. So we can turn the above to

class NoteFragment < Props::Fragment
end
json.note(NoteFragment.new(@club_note.id))

Internally we'll call something like responds_to?(:to_prop_options)which we can call to return the work done at #56

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions