Sha256: ec5324e9f057eecd224e3eef8b3884ca34223edce06915ed17cd04f1a7f34003
Contents?: true
Size: 671 Bytes
Versions: 10
Compression:
Stored size: 671 Bytes
Contents
module StimulusReflex class RequestParameters def initialize(params:, req:, url:) @params = params @req = req @url = url end def apply! path_params = Rails.application.routes.recognize_path_with_request(@req, @url, @req.env[:extras] || {}) path_params[:controller] = path_params[:controller].force_encoding("UTF-8") path_params[:action] = path_params[:action].force_encoding("UTF-8") @req.env.merge(ActionDispatch::Http::Parameters::PARAMETERS_KEY => path_params) @req.env["action_dispatch.request.parameters"] = @req.parameters.merge(@params) @req.tap { |r| r.session.send :load! } end end end
Version data entries
10 entries across 10 versions & 1 rubygems