FCKEditor to create ERB pages

2 views
Skip to first unread message

Jason Cartwright

unread,
May 10, 2009, 12:23:12 AM5/10/09
to orug-di...@googlegroups.com
I'm using FCKEditor in a Rails application. I'd like to allow the page body to include erb elements, which works fine when I initially add them. I can render the pages using <%= render :inline => @page.body %> and it works. However, when I edit the content again in the FCKEditor, it escapes the <% %> tags with &lt; and &gt;. Does anyone know how to tell the editor NOT to mangle my erb tags?

Thanks,
Jason

Jason Cartwright

unread,
May 10, 2009, 12:56:55 AM5/10/09
to orug-di...@googlegroups.com
Seems I have answered my own question... in the fckconfig_custom.js you can add ProtectedSource definitions:

FCKConfig.ProtectedSource.Add( /<%[\s\S]*?%>/g ) ;
FCKConfig.ProtectedSource.Add( /<%=(.*?)%>/g ) ;
Reply all
Reply to author
Forward
0 new messages