首页 > 解决方案 > 使用 css 格式化生成的按钮

问题描述

我正在尝试将 css 类(push_button)应用于呈现的按钮。

     buttons = if is_rc?
    ['Approve', 'Submit', 'Incomplete', 'Reject']
  elsif !@product.my_product?
    ['Save']
  elsif @product.container_type || !@product.uses_ingredients.empty?
    ['Submit for certification']
  else
    ['Continue to formula']
  end
  buttons.map {|b| submit_tag(b), (:class => "push_button") }.join(' ') %>

这会导致错误。关于如何做到这一点的任何想法?

标签: ruby-on-rails

解决方案


推荐阅读