mirror of
https://github.com/we-promise/sure.git
synced 2026-04-21 21:14:17 +00:00
Fix translation scope within modals (#404)
* Patch virtual_path within modal helper Added an example translation within the modal to test. * Fix modal translation scope By changing this to a partial that accepts the content via a local var instead of a layout the virtual path, and therefore translation scope is not changed.
This commit is contained in:
@@ -14,6 +14,7 @@ module ApplicationHelper
|
||||
# Wrap view with <%= modal do %> ... <% end %> to have it open in a modal
|
||||
# Make sure to add data-turbo-frame="modal" to the link/button that opens the modal
|
||||
def modal(&block)
|
||||
render "shared/modal", &block
|
||||
content = capture &block
|
||||
render partial: "shared/modal", locals: { content: content }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user