Open sighmon opened 8 years ago
I've made an initialiser for now..
# config/initializers/mjml.rb
class Mjml::Rails::ERBContext
include ActionView::Helpers
include ::Rails.application.routes.url_helpers
default_url_options[:host] = Rails.env.production? ? ENV['APP_HOST'] : 'localhost:3000'
end
I couldn't get partials to work either, so I ended up writing a Rails Gem: https://github.com/sighmon/mjml-rails
I'd like to be able to use ActionController::Base.helpers and route helpers in
my_template.mjml
.For example
Throws the error:
I'd also like to use:
Should the helpers be included in https://github.com/angelodlfrtr/mjml-ruby/blob/master/lib/mjml/rails/erb_context.rb ?