Class: Thredded::EmailTransformer::Onebox
- Defined in:
- lib/thredded/email_transformer/onebox.rb
Overview
Wraps oneboxes with tables, because only tables can have borders in most email clients.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Methods included from Helpers
Constructor Details
This class inherits a constructor from Thredded::EmailTransformer::Base
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/thredded/email_transformer/onebox.rb', line 8 def call doc.css('aside.onebox').each do |onebox| table = Nokogiri::XML::Node.new('table', doc) table['class'] = 'onebox-wrapper-table' onebox.swap table table .add_child(Nokogiri::XML::Node.new('tr', doc)) .add_child(Nokogiri::XML::Node.new('td', doc)) .add_child(onebox) end end |