serve icon indicating copy to clipboard operation
serve copied to clipboard

Slim view helpers and layouts

Open gustin opened this issue 14 years ago • 3 comments

Thanks for the work on serve, it is helping us prototype apps.

We are using Slim templates and seem to be having some problems.

The default view helpers don't seem to work, it appears the helpers are parsed before slim is parsed so slim interrupts them and adds quotes around the tags.

If we have a layout that is in slim and yield to a slim file it won't compile the yielded file correctly. If the layout is in erb and we yield to a slim file it works though.

Any ideas?

thanks, gustin

gustin avatar Jun 29 '11 17:06 gustin

Slim support is fairly new, so there are probably some issues with it. I'll need to look into this.

One thing, you might try this with the prerelease version of Serve:

gem install --pre serve

I have reworked a couple of things which may impact the issues that you are struggling with. No guarantees, but it might be a little better.

Thanks for reporting this.

jlong avatar Jun 29 '11 18:06 jlong

Just to add to that, the Slim support doesn't currently handle capture blocks like so:

= content_for :title do 
  | Crazy Bat Ape

You'll get an error like this:

Capture not supported for `slim' template (Slim::Template)

rmanalan avatar Jul 25 '11 18:07 rmanalan

@gustin, was your issue with slim resolved?

@manalang, that's true, capture is currently only supported for erb templates. You might be able to use the new pipelining to do the capturing in erb before passing to the slim engine, or we'd accept a Pull Request to add direct support for capturing in slim.

ntalbott avatar Apr 06 '12 13:04 ntalbott