-
What i want to is, get query params, e.g. params["q"], like "/universities?q=foo",and fill the Thanks |
Beta Was this translation helpful? Give feedback.
Answered by
zw963
May 3, 2024
Replies: 1 comment 1 reply
-
You can use class FooAction < BrowserAction
param q : String
expose query_param
get "/universities" do
html FooPage
end
private def query_param
q
end
end
class FooPage < MainLayout
needs query_param : String
def content
h1 query_param
end
end |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, i found i can get query_params use
context.request.query_params["q"]
in page directly, this way is a little simple then pass from action, furthermore, latter have to create a method.