【发布时间】:2018-04-20 21:10:43
【问题描述】:
我对 Rails 比较陌生。我有以下image。
我想要一个文本字段来在单击更新按钮时替换数字,并保持之前的数字,显示的按钮更改为确认。
我的应用程序中有以下内容。
%tr[fund_flow]
%td= fund_flow.symbol
%td= fund_flow.trade_date
%td= number_to_currency(fund_flow.nav, unit: '')
%td= number_to_currency(fund_flow.shares_outstanding, unit: '')
%td= label_tag("N/A", number_to_currency(fund_flow.fund_flow, unit: ''), {style: "#{'display:show' if flag}"})
%td
= form_tag(update_nav_history_path(fund_flow.id), method: "post") do
= text_field_tag("update", nil, {style: "#{'display:none' if !flag}"})
= submit_tag("Update")
以下内容帮助我走到了这一步。 solution
不确定如何设置全局标志变量并更改设置标志时发生的情况。
【问题讨论】:
标签: ruby-on-rails forms ruby-on-rails-4