padrino-framework: link_to with block in slim doesn't seem to work
I am using slim as my template syntax and using a block with the link_to helper doesn’t work.
My test is like this:
== link_to("/") do
span Hello
It doesn’t print anything.
I digged into the code and traced it back to SlimHandler.concat_to_template:
def concat_to_template(text="")
self.output_buffer << text if is_type? && text
nil
end
It doesn’t come from the condition, I commented it and it didn’t change anything.
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 28 (13 by maintainers)
Commits related to this issue
- remove Improve slim template block capturing fix #777 — committed to WaYdotNET/padrino-framework by WaYdotNET 12 years ago
- Revert slim fix on capturing, RIF: #777 — committed to padrino/padrino-framework by DAddYE 12 years ago
@pencilcheck and @akiva
Not sure if you figured this out by now, but I was trying to do something like:
This didn’t work. This is because I’m trying to set the content of the link with the first argument of
link_to, when of course the content of the block is doing that.Once you remove that first argument:
= link_to channel_path(channel) doit works!