Skip to content

Render ctx table#41

Open
yogeshjain999 wants to merge 1 commit intotrailblazer:masterfrom
yogeshjain999:ctx-table
Open

Render ctx table#41
yogeshjain999 wants to merge 1 commit intotrailblazer:masterfrom
yogeshjain999:ctx-table

Conversation

@yogeshjain999
Copy link
Copy Markdown
Member

Add Trailblazer::Developer::Context.render(ctx, *keys) to render ctx using hirb table, for better visibility 👓

ctx = Trailblazer::Context({ current_user: User.new(1), params: { name: "John" } })
ctx[:say] = "something"
ctx[:params] = { id: 1 }

Trailblazer::Developer::Render::Context.(ctx) =>
********** ctx **********
┌───────────────┬────────────────────────────────────────┐
│ key           │ value                                  │
├───────────────┼────────────────────────────────────────┤
│ :current_user ╎ #<struct RenderContextTest::User id=1> │
│ :params       ╎ {:name=>"John"}                        │
└───────────────┴────────────────────────────────────────┘

********** ctx mutations **********
┌─────────┬─────────────┐
│ key     │ value       │
├─────────┼─────────────┤
│ :say    ╎ "something" │
│ :params ╎ {:id=>1}    │
└─────────┴─────────────┘

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

Successfully merging this pull request may close these issues.

1 participant