В вашем /your_extension.rb
:
def activate
Page.send :include, YourCustomTags
end
your_custom_tags.rb
module YourCustomTags
include Radiant::Taggable
tag 'custom' do |tag|
tag.expand
end
tag "custom:form" do |tag|
tag.attr['id'] ||= 'newsletter'
results = []
action = "/newsletters/"
results << %(<form action="#{action}" method="post" #{newsletter_attrs(tag)}>)
results << %(<input name="authenticity_token" type="hidden" value="#{response.instance_variable_get(:@session)[:_csrf_token]}" />)
results << tag.expand
results << %(</form>)
end
Это пройдет аутентичность.