Skip to content

Commit

Permalink
Redirect to '/' if root_path can't be evaluated (#142)
Browse files Browse the repository at this point in the history
  • Loading branch information
dnsos authored Nov 25, 2024
1 parent b0093de commit 79b6178
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/invisible_captcha/controller_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def on_timestamp_spam(options = {})
send(action)
else
flash[:error] = InvisibleCaptcha.timestamp_error_message
redirect_back(fallback_location: root_path)
redirect_back(fallback_location: defined?(root_path) ? root_path : "/")
end
end

Expand Down

0 comments on commit 79b6178

Please sign in to comment.