How to pass an argument when calling a view file?

后端 未结 4 706
深忆病人
深忆病人 2021-02-04 01:38

I wrote a webform using Sinatra and Haml that will be used to call a Ruby script.

Everything seems fine except for one thing: I need to pass an argument to a Haml view f

4条回答
  •  忘了有多久
    2021-02-04 01:43

    Given

    haml(template, options = {}, locals = {})
    

    I'd try

    haml :success, {}, {my_var: my_value}
    

提交回复
热议问题