Open nomasprime opened 6 years ago
Hi Rick, we're in the process of finalizing the API, and then you will get new docs!
Thanks @apotonick, very much appreciated and liking Trailblazer 👍
In the meantime I have this controller:
class ArticlesController < ApplicationController
include Trailblazer::Endpoint::Controller
def show
endpoint Article::Operation::Show.(:id => params[:id]) do |m|
m.success do |result|
render :html => cell(
Article::Cell::Show,
result["model"],
:layout => App::Cell::Layout
)
end
end
end
end
I'm getting uninitialized constant Trailblazer::Endpoint::Controller::Handlers
.
Any ideas?
Not sure if I'm the bug so thought I'd mention here and raise separately if need be.
Uhm, it looks like you're using a very old version, I can give you a working version later tonight.
@apotonick no probs. I'll pop it on Gitter in meantime, client's breathing down my neck 🙄
Not sure this will help, since that gem hasn't been released, yet, and underwent many changes and redesigns.
@apotonick cool, I'll put in a workaround for now until you get a chance.
Yeah, just run the op manually in the controller and add some if
s, I can later help you migrate it to the stable API.
class ArticlesController < ApplicationController
def show
result = Article::Operation::Show.(:id => params[:id])
if result.success?
render :html => cell(
Article::Cell::Show,
result["model"],
:layout => App::Cell::Layout
)
elsif result["model"].nil?
render(
:html => cell(
App::Cell::Error,
nil,
:layout => App::Cell::Layout
),
:status => 404
)
end
end
end
I'm a TB noob, can you tell 😄
So there's one thing you could take advantage of already, that's render
from trailblazer-rails
: http://trailblazer.to/gems/trailblazer/2.0/rails.html#render
Other than that, what you do here is basically what your endpoint will abstract in a few hrs. :stuck_out_tongue_winking_eye:
Hello!
Is there an ETA for the gem's release?
Good timing, there's an endpoint
team meeting scheduled for next week, we will then publish a roadmap. I'd say somewhere in March?
Excellent! I'm looking forward to it.
The endpoint code has been moved from Trailblazer to here but it looks like process wasn't completed because the only way I can seem to use the gem is bundling directly from Github.
Docs also need updating.