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

unexpected & error #58

Open
andrey-lizunov opened this issue Nov 24, 2016 · 5 comments
Open

unexpected & error #58

andrey-lizunov opened this issue Nov 24, 2016 · 5 comments

Comments

@andrey-lizunov
Copy link

With version 0.10.0 I have this error (unexpected &) when try to load a page with js which use this template

.some_class class="#{@status}"
  span=@message

I found that the problem in this part class="#{@status}
But this code works perfect with version 0.9.3
Not sure is it bug or I do something wrong. If it's OK, then could you tell me how I can implement dynamic classes?

@svicalifornia
Copy link
Collaborator

svicalifornia commented Nov 24, 2016

Sorry for this regression. While we work on a fix, please try this:

.some_class class=@status
  span=@message

@andrey-lizunov
Copy link
Author

Thx for so fast reply.
I tried this and it doesn't work too. Same error message.

@svicalifornia
Copy link
Collaborator

svicalifornia commented Nov 24, 2016

If that doesn't work, then you may need to do this for now:

div class="some-class #{@status}"
  span=@message

@mahemoff
Copy link

There is something magic about "class" attribute causing this. I got this error, changed the attribute name to something else, and it worked fine. This unfortunately means it's not possible to set class dynamically afaict, as hash arguments are also not supported (#29).

@mahemoff
Copy link

Actually @svicalifornia's workaround works. Use something like div class="dummy_class #{@real_class}"

I still think this is a bug with the special case of "class" attribute name.

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

3 participants