Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix translate request issue which is failing on 400 bad request #77

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ window.RecurringSelectDialog =
$.ajax
url: "<%= Rails.application.config.action_controller.relative_url_root %>/recurring_select/translate/#{$.fn.recurring_select.texts["locale_iso_code"]}",
type: "POST",
data: @current_rule.hash
data: JSON.stringify(@current_rule.hash)
success: @summaryFetchSuccess

summaryFetchSuccess: (data) =>
Expand Down
4 changes: 1 addition & 3 deletions app/middleware/recurring_select_middleware.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ def call(env)
regexp = /^\/recurring_select\/translate\/(.*)/
if env["PATH_INFO"] =~ regexp
I18n.locale = env["PATH_INFO"].scan(regexp).first.first
request = Rack::Request.new(env)
params = request.params
params.symbolize_keys!
params = env["action_dispatch.request.request_parameters"]

if params and params[:rule_type]
rule = RecurringSelect.dirty_hash_to_rule(params)
Expand Down