Rendering partial with locals in Haml?

泄露秘密 提交于 2019-11-28 17:50:31

Try this
Without :locals and :partial

.content
  = render 'meeting_info', :info => @info

No need to specify locals.

With :locals and :partial
You should specify locals in following case i.e specifying :partial for render

.content
  = render :partial => 'meeting_info', :locals => { :info => @info }
dearlbry

You would use the :locals option if you're calling render from a controller. When calling render from a view, you would simply do this:

= render 'meeting_info', :info => @info
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!