This project is archived and is in readonly mode.

#6474 new
Daniel Morrison

Convert csrf_meta_tags to use the tag helper

Reported by Daniel Morrison | February 26th, 2011 @ 06:47 PM

csrf_meta_tags is one of the few places that use an html string and not the tag helper. Seems like it should for consistency (and for picking up overrides to the tag helper, which I was doing in project when I discovered this).

I'm not excited about the tap & join pattern, so I'm happy to change it.

Comments and changes to this ticket

  • robinjam

    robinjam April 6th, 2011 @ 03:09 AM

    The tap-and-join thing seems needlessly complicated. Something like this should work:

    [tag('meta', {:name => 'csrf-param', :content => request_forgery_protection_token}), tag('meta', {:name => 'csrf-token', :content => form_authenticity_token})].join("\n").html_safe

    Aside from that, this is a good fix. Have you tried submitting a pull request?

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Attachments

Tags

Pages