Sha256: ce23d9cf75cf97455c3d23e129b9bd4c0a2f96e13dbb160fdd20dca7713a992d

Contents?: true

Size: 401 Bytes

Versions: 2

Compression:

Stored size: 401 Bytes

Contents

module RequirejsControllersHelper
  def requirejs_controller_tag
    html = requirejs_include_tag
    html.concat <<-HTML.html_safe
    <script>
    define('main', function() {
      require(['controllers/#{controller.controller_path}'], function(controller) {
        window.controller = new controller('#{controller.action_name}')
      })
    })
    </script>
    HTML
    html.html_safe
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
requirejs-controllers-0.1.1 app/helpers/requirejs_controllers_helper.rb
requirejs-controllers-0.1.0 app/helpers/requirejs_controllers_helper.rb