Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad assignation of partials with includePath: true #39

Open
andresbravog opened this issue Apr 17, 2016 · 0 comments
Open

Bad assignation of partials with includePath: true #39

andresbravog opened this issue Apr 17, 2016 · 0 comments

Comments

@andresbravog
Copy link

Having gruntfile

    haml:
      compile:
        files:
          "assets/compiled/templates.js": [ "assets/javascripts/**/*.hamlc" ]
        options:
          target: 'js'
          language: 'coffee'
          includePath: true
          pathRelativeTo: './assets/javascripts/backbone/',
          dependencies:
            $: 'jquery',
            _: 'underscore'
            I18n: 'i18n'

and some partials in my views I end up with the error

Running "haml:compile" (haml) task
>> [stdin]:2:41: error: the variable "_basket_prize" can't be assigned with ?= because it has not been declared before
>> window.HAML.apps/lottery/show/templates/_basket_prize ?= {}
>>                                         ^^^^^^^^^^^^^
Warning: Haml failed to compile. Use --force to continue.

as you can see views are correctly assigned with

window.HAML['tasks'] = function(context) {
    return (function() {
...

but templates are wrongly assigned with

window.HAML.apps/lottery/_basket_prize['jst'] = function(context) {
    return (function() {
      var $o;
      $o = [];
      $o.push("<div class='name'></div>\n<div class='quantity'></div>\n<div class='remove'>&times;</div>");
      return $o.join("\n").replace(/\s(?:id|class)=(['"])(\1)/mg, "");
    }).call(context);
  };

Any idea how to solve this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant