Rails: Is it possible to write view helpers with HAML syntax?

后端 未结 4 1211
萌比男神i
萌比男神i 2021-02-12 19:05

During refactoring it would be quite handy just to copy part of HAML template and paste it to helper\'s code. Currently in such cases 1) I have to rewrite that part of view from

4条回答
  •  情歌与酒
    2021-02-12 20:04

    If all you are after is a method for small reusable snippets, how about partials with local variables? http://guides.rubyonrails.org/layouts_and_rendering.html#using-partials

提交回复
热议问题