-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c855b05
commit aeb2bcf
Showing
3 changed files
with
45 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package no.datek.slim; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.servlet.ViewResolver; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
import org.springframework.web.servlet.view.script.ScriptTemplateConfigurer; | ||
import org.springframework.web.servlet.view.script.ScriptTemplateViewResolver; | ||
|
||
@Configuration | ||
public class SlimConfigurer implements WebMvcConfigurer { | ||
@Bean | ||
public ViewResolver scriptTemplateViewResolver() { | ||
ScriptTemplateViewResolver resolver = new ScriptTemplateViewResolver(); | ||
resolver.setPrefix("/views/"); | ||
resolver.setSuffix(".slim"); | ||
return resolver; | ||
} | ||
|
||
@Bean | ||
public ScriptTemplateConfigurer jrubyConfigurer() { | ||
ScriptTemplateConfigurer configurer = new ScriptTemplateConfigurer(); | ||
configurer.setEngineName("jruby"); | ||
configurer.setScripts("ruby/load_slim.rb"); | ||
configurer.setRenderFunction("render_slim"); | ||
return configurer; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters