所以执行这个会给我一个错误:
no block given (yield)
好吧,从来没有深入研究过 ruby 中的块,这似乎是这里的一个问题。如果您有更好的解决方案,请提供,否则我想为这个遗留代码找到一个解决方法......
def tab_groupings
结果 = at_a_glance_grouping
结果 += rating_grouping 如果 @domain_context.include_ratings 和 (controller.controller_name !='rewards_credit_cards')
结果 += specific_tab_groupings
结果
结尾
def at_a_glance_grouping
结果 = [[:at_a_glance, 产量]]
product_type = controller.controller_name == 'fairfax' ? @product_type_helper[:controller]:controller.controller_name
result[0][1].insert(0, :overall_rating) if @domain_context.include_ratings 和 (product_type !='rewards_credit_cards')
结果
结尾