Guest User

Untitled

a guest
May 24th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. require_dependency 'application'
  2.  
  3. class AuthenticityTokenExtension < Radiant::Extension
  4. version "1.0"
  5. description "Tag which renders the form_authenticity_token, useful for integration with other rails app"
  6.  
  7. def activate
  8. SiteController.class_eval {
  9. session :disabled => false
  10.  
  11. def process_page_with_token(page)
  12. process_page_without_token(page)
  13. page.token = form_authenticity_token if page.class_name == "AuthenticityTokenPage"
  14.  
  15. logger.warn "process_page_with_token executed: (#{page.token})"
  16. end
  17. alias_method_chain :process_page, :token
  18. }
  19.  
  20. AuthenticityTokenPage
  21. end
  22.  
  23. end
Add Comment
Please, Sign In to add comment