0
我想为邮件列表设置一个简单的表单。是否可以在Radiant CMS中传递rails变量?
而且它似乎不允许任何rails助手做form_for和履行真实性标记。
任何人都有运气在Radiant上安装一个简单的form_for?
我想为邮件列表设置一个简单的表单。是否可以在Radiant CMS中传递rails变量?
而且它似乎不允许任何rails助手做form_for和履行真实性标记。
任何人都有运气在Radiant上安装一个简单的form_for?
在你/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
这将通过真实性。