-
|
Following is a example class Docs::Htmx::Reply < DocAction
param user_id : Int64
param doc_id : Int64
param content : String
param doc_path : String
# 回复评论按钮
post "/docs/htmx/reply" do
me = current_user
return head 401 if me.nil?
return head 401 if user_id != me.id
return head 400 if content.blank?
SaveReply.create(user_id: user_id, doc_id: doc_id, content: content) do |op, saved_reply|
if op.saved?
component(
Component::Docs::FormWithReplies,
formatter: formatter,
pagination: replies_pagination(doc_path: doc_path),
current_user: me,
doc_path: doc_path,
order_by: "desc"
)
else
head 400
end
end
end
endI want to get the When run I don't care about the params, just want get the Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
jwoertink
Jun 15, 2025
Replies: 1 comment 3 replies
-
|
I think you would do |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just to clarify, this is because you stated that the query params like
user_idare required, andpathassumes the whole thing... I think maybe we should consider renaming thesepath=>resourceandpath_without_query_params=>path... Though, it would be a breaking change, and may cause some confusion even though it's a bit more correct 🤔