문제

I am semi-forking Redmine for my company and rarely pulling improvements from upstream. I prefer to use SLIM over ERB for views. My idea is that I want to keep erb files intact for the sake of easier diff-ing when I pull changes from upstream, still I want to only use SLIM versions of the templates. So where I have

index.html.erb

and

index.html.slim

I want Rails to only search for index.html.slim and take no notice about the existence of the erb variant. Is it possible to make the two variants coexist side-by-side in the same folder and only use SLIM here?

도움이 되었습니까?

해결책

You can do something like this in the controllers:

respond_to do |format|
  format.html { render handlers: [:slim] }
end

Or if you want to override it specifically for one view:

render "path/view", handlers: [:slim]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top