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

Using with riot.js (tag.slim) #649

Closed
brauliobo opened this issue Sep 6, 2015 · 6 comments
Closed

Using with riot.js (tag.slim) #649

brauliobo opened this issue Sep 6, 2015 · 6 comments

Comments

@brauliobo
Copy link

The following example does not work with https://github.com/bjarosze/riot_js-rails.
With the js.tag, riot_js-rails compile it successfully to javascript. But when the .slim extension is used, sprockets can't even find it.

Any clue why?

submissions
  table.table
    thead
      th blah
      th blah2
      th blah3
    tbody
      tr each={i in [1,2,3]}
        td {i}

   this.abc = 'test'
@brauliobo
Copy link
Author

Oh, I see slim does not define a Sprockets processor! Ok to send a PR?

@brauliobo
Copy link
Author

Issued at sstephenson/sprockets#674

@brauliobo
Copy link
Author

There seems to have a deeper problem here: Slim will try to parse the javascript on the component. Still trying to figure out some solution.

@brauliobo
Copy link
Author

Another problem would be to use { js }, I keep having syntax errors.

Seems to be hard to use slim outside ruby, will give skim a try...

@brauliobo
Copy link
Author

Possible with workaround at #650

@brauliobo
Copy link
Author

Also, Riot needs pretty templates to be able to parse them, so a sprockets engine can be registered like this:

Slim::PrettyTemplate = Temple::Templates::Tilt Slim::Engine, register_as: :slim, pretty: true
Rails.application.assets.register_engine '.slim', Slim::PrettyTemplate

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