This makes clover.rb only hold the plugin and route configuration. Most methods are in routes/helpers/general.rb. Web-specific methods are in routes/helpers/web.rb, and runtime-specific methods are in routes/helpers/runtime.rb.
13 lines
287 B
Ruby
13 lines
287 B
Ruby
# frozen_string_literal: true
|
|
|
|
class Clover < Roda
|
|
def csrf_tag(*)
|
|
render("components/form/hidden", locals: {name: csrf_field, value: csrf_token(*)})
|
|
end
|
|
|
|
def redirect_back_with_inputs
|
|
flash["old"] = request.params
|
|
request.redirect env["HTTP_REFERER"] || "/"
|
|
end
|
|
end
|