【问题标题】:How to break the line inside the brackets [closed]如何打破括号内的线[关闭]
【发布时间】:2013-01-08 15:07:53
【问题描述】:

我希望能够在括号内换行而不会出现“括号不一致”错误。

这是一个例子:

select.someclass.something{data: {max_amount: o.max_amount_clean, max_amount: o.min_amount_clean, fee: o.fee_clean}} 

谢谢

【问题讨论】:

  • 你是怎么破解的?您可能需要一个 \ 作为连续字符。
  • 这是一个Haml语句吗?你不是说%select.someclass...吗?

标签: ruby-on-rails ruby haml


【解决方案1】:

我不确定我是否理解,但如果参数是哈希而不是块,就像看起来那样,你可以这样做

select.someclass.something(
  {data: 
      {max_amount: o.max_amount_clean, 
       max_amount: o.min_amount_clean, 
       fee: o.fee_clean}}
)

【讨论】:

  • 我收到“无效属性列表”错误
  • 就像其他人说的那样,这个问题太模糊了,无法理解。是Ruby还是haml?提出技术问题时,一般方法是尝试找到问题出现的最小情况,这对于隔离问题至关重要。
猜你喜欢
  • 1970-01-01
  • 2020-01-25
  • 2012-01-19
  • 1970-01-01
  • 2010-09-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多