Closed jdickey closed 9 years ago
I think this is likely again the same issue as #34: without access to Rails integration, no helpers will work, because the widget isn’t attached to a Rails view_context
(which, in turn, requires an instantiated controller). With access to that, it should all just work, and you most definitely shouldn’t have to call it as Fortitude::Rails::Helpers.csrf_meta_tags
— just plain csrf_meta_tags
should work just fine.
If you find that anything else is going on, by all means, let me know, and I’ll fix it ASAP!
When I have a widget that generates a raw-HTML
form
tag (rather than usingform_for
or similar helpers), I'm responsible for explicitly including CSRF-protectionmeta
tags as hidden fields. Fine; I'd think that should just be a matter of calling the:csrf_meta_tags
helper in the form (which Fortitude lists inFortitude::Rails::Helpers
.Simple, right? Not so much…
What am I missing?
Directly relevant widget source here; any of these tests will demonstrate the failure (as rendering the form to HTML will fail).