ruby-on-rails - 使用 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(' ') %>
这会导致错误。关于如何做到这一点的任何想法?
解决方案
推荐阅读
- javascript - 将客户端时间设置为服务器时间并实时更新
- android - 内联函数导致单元测试代码覆盖率报告出错
- python - 使用 For-Else 会执行这两个条件。我该如何解决?
- c - 为什么我们在函数名上使用 & 符号?
- java - 无法理解何时必须将 return 语句与递归关联使用
- javascript - 如何使用或不使用javascript在数字之间添加垂直线?
- python - 如何修复 AttributeError:“NoneType”对象没有“点击”属性
- node.js - NodeJS GCP pubsub 发布错误:t.topic(...).publish 不是函数
- c++ - 用于旋转网格的 OpenGL ArcBall
- ms-word - 如何捕获任务窗格中动态内容的点击事件?