lexxy-variables 1.0: variables for Lexxy rich text
lexxy-variables 1.0 is out. It adds variables to Lexxy, the new rich text editor for Rails. Authors type {{ or use a toolbar menu to insert a variable, which is saved as an Action Text attachment, not as template markup. When you render, you pass a hash and with_variables swaps each one for its value:
<%= @record.body.with_variables(first_name: @person.first_name) %>
Values are always escaped, and Liquid is opt-in, so it’s safe out of the box. The catalog can be a simple list or a database model. The result works as HTML, plain text, and Markdown, so it fits views, mailers and jobs. It matches your Lexxy theme out of the box, and every piece can be restyled.
Try it on the demo site.
Post a comment