Interesting, I haven’t experienced that problem yet, but my approach seems to slightly differ from yours. I’ve found that including the turbo_stream.* actions within the controller can get messy quick, so I’ve been putting them all in *.turbo_stream.erb templates. I wonder if refactoring the provided example to something like what I have below might work.
The refactored controller action:
# app/controllers/messages_controller.rb
def create
@message = Message.create!(params.require(:message).permit(:content))
respond_to do |format|
format.turbo_stream { render :create_success }
format.html { redirect_to messages_url }
end
end
The message partial, adjusted to reference the user local instead of the current_user:
<!-- app/views/messages/_message.html.erb -->
<div id="<%= dom_id message %>">
<span class="from">
<% if message.user == user %>
You
<% else %>
<%= message.user.name %>
</span>:
<%= message.content %>
</div>
The stimulus controller was an interesting hack, but probably not ideal as your codebase grows as it would result in a lot of one-off stimulus controllers that only serve as workarounds.
I think it is more like that, given that the autor has mentioned the author of the original idea (???) in a tweet, and I have found this repo under that name. And the graphic seems pretty similar to the one shown in the original repo.
But how did it all happen, is this copied or what… I do not have an idea…
algoheader is a CLI frontend to the ascii-to-svg library that does a couple things that simplify/automate using that library. It’s listed in the dependencies, but I’ll update the README to feature that gem more prominently so that there’s no confusion.
Nice, this seems to be a great idea. I’ve struggled to find a good instance to join, but this looks promising. I really like how the post rules state: “All top-level posts must be directly related to FOSS development.” I think this will serve to maintain a better signal-to-noise ratio. I sent my request to join to the operator.
Interesting, I haven’t experienced that problem yet, but my approach seems to slightly differ from yours. I’ve found that including the
turbo_stream.*actions within the controller can get messy quick, so I’ve been putting them all in*.turbo_stream.erbtemplates. I wonder if refactoring the provided example to something like what I have below might work.The refactored controller action:
The turbo stream action extracted to a template:
The message partial, adjusted to reference the
userlocal instead of thecurrent_user:The stimulus controller was an interesting hack, but probably not ideal as your codebase grows as it would result in a lot of one-off stimulus controllers that only serve as workarounds.
I feel like the repository (and docs) could use examples.
Promoting tool that creates “beautiful” graphic without any showcase is at least weird.
EDIT: Assuming that author uses this tool on their own blog it looks like that.
I think it is more like that, given that the autor has mentioned the author of the original idea (???) in a tweet, and I have found this repo under that name. And the graphic seems pretty similar to the one shown in the original repo.
But how did it all happen, is this copied or what… I do not have an idea…
algoheader is a CLI frontend to the ascii-to-svg library that does a couple things that simplify/automate using that library. It’s listed in the dependencies, but I’ll update the README to feature that gem more prominently so that there’s no confusion.
Haven’t had a chance to update my blog with any of the generated images yet, but I’ll be sure to add examples to the README.
Yes. Was also looking for screenshots.
I’ll definitely add screenshots–apologies for the oversight!
Nice, this seems to be a great idea. I’ve struggled to find a good instance to join, but this looks promising. I really like how the post rules state: “All top-level posts must be directly related to FOSS development.” I think this will serve to maintain a better signal-to-noise ratio. I sent my request to join to the operator.