emberjs/ember-rails

Precompile error on "(query-params" syntax

Blackening999 opened this issue · 5 comments

In my Gemfile:

Stacktrace updated

gem 'ember-rails', '0.18.1'
gem 'ember-source', '1.7.1'

checked handlebars version - 1.3.0

Console:

. Compiler said: Error: Parse error on line 7:
..."btn"              (query-params rankin
----------------------^
Expecting 'CLOSE', 'CLOSE_UNESCAPED', 'CLOSE_SEXPR', 'ID', got 'OPEN_SEXPR'
 (in /Users/black/Work/ ...   file.hbs):
  barber (0.9.0) lib/barber/precompiler.rb:25:in `rescue in compile'
  barber (0.9.0) lib/barber/precompiler.rb:23:in `compile'
  barber (0.9.0) lib/barber/precompiler.rb:8:in `compile'
  ember-handlebars-template (0.1.5) lib/ember/handlebars/helper.rb:67:in `precompile_ember_handlebars'
  ember-handlebars-template (0.1.5) lib/ember/handlebars/templates/sprockets2.rb:42:in `evaluate'
  tilt (1.4.1) lib/tilt/template.rb:103:in `render'
  sprockets (2.11.0) lib/sprockets/context.rb:197:in `block in evaluate'

Could you provide an example code?

Sure

<div class='centered'>
        {{#link-to 'aa' class="btn"
          (query-params ranking_category="aa") tagName="button"}}
            INFO
        {{/link-to}}
        {{#link-to 'aa.rankings' class="btn"
          (query-params ranking_category="aa") tagName="button"}}
            INFO
        {{/link-to}}
    </div>

It's very strange :(

The query params should be placed before options.
The following code works for me.

 <div class='centered'>
  {{#link-to 'aa'
    (query-params ranking_category="aa") class="btn" tagName="button"}}
      INFO
  {{/link-to}}
  {{#link-to 'aa.rankings'
    (query-params ranking_category="aa") class="btn" tagName="button"}}
      INFO
  {{/link-to}}
</div>

You are my hero :)

😎