Module: Erubis::Helpers::RailsHelper

Defined in:
lib/erubis_rails_helper/template_handlers/erubis.rb

Overview

helper module for Ruby on Rails

howto:

  1. add the folliwng code in your ‘config/environment.rb’

    require 'erubis/helpers/rails_helper'
    #Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby # or Erubis::FastEruby
    #Erubis::Helpers::RailsHelper.init_properties = {}
    #Erubis::Helpers::RailsHelper.show_src = false       # set true for debugging
    #Erubis::Helpers::RailsHelper.preprocessing = true   # set true to enable preprocessing
    
  2. restart web server.

if Erubis::Helper::Rails.show_src is true, Erubis prints converted Ruby code into log file (‘log/development.log’ or so). if false, it doesn’t. if nil, Erubis prints converted Ruby code if ENV == ‘development’.

Defined Under Namespace

Modules: TemplateConverter Classes: PreprocessingEruby

Constant Summary collapse

@@engine_class =

cattr_accessor :init_properties

::Erubis::Eruby
@@init_properties =

cattr_accessor :init_properties

{}
@@show_src =

cattr_accessor :show_src

nil
@@preprocessing =

cattr_accessor :preprocessing

false

Class Method Summary collapse

Class Method Details

.engine_classObject

@@engine_class = ::Erubis::FastEruby



145
146
147
# File 'lib/erubis_rails_helper/template_handlers/erubis.rb', line 145

def self.engine_class
  @@engine_class
end

.engine_class=(klass) ⇒ Object



148
149
150
# File 'lib/erubis_rails_helper/template_handlers/erubis.rb', line 148

def self.engine_class=(klass)
  @@engine_class = klass
end

.init_propertiesObject



154
155
156
# File 'lib/erubis_rails_helper/template_handlers/erubis.rb', line 154

def self.init_properties
  @@init_properties
end

.init_properties=(hash) ⇒ Object



157
158
159
# File 'lib/erubis_rails_helper/template_handlers/erubis.rb', line 157

def self.init_properties=(hash)
  @@init_properties = hash
end

.preprocessingObject



172
173
174
# File 'lib/erubis_rails_helper/template_handlers/erubis.rb', line 172

def self.preprocessing
  @@preprocessing
end

.preprocessing=(flag) ⇒ Object



175
176
177
# File 'lib/erubis_rails_helper/template_handlers/erubis.rb', line 175

def self.preprocessing=(flag)
  @@preprocessing = flag
end

.show_srcObject



163
164
165
# File 'lib/erubis_rails_helper/template_handlers/erubis.rb', line 163

def self.show_src
  @@show_src
end

.show_src=(flag) ⇒ Object



166
167
168
# File 'lib/erubis_rails_helper/template_handlers/erubis.rb', line 166

def self.show_src=(flag)
  @@show_src = flag
end