How to pass an argument when calling a view file?

后端 未结 4 644
深忆病人
深忆病人 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:53

    I'm doing this in Sinatra+Markaby, I think it should be the same with Haml:

    In Ruby script: @var = 'foo'

    In template: User name: #{@var}

提交回复
热议问题