ビューに次のようなフォームがあります。
<%= form_tag("mystuff/new", method: "get") do %>
<% @accesses.each do |access| %>
<%= radio_button_tag(:cost, access.cost) %>
<%= label_tag :label,access.label, :class=>"control-label" %>
<%= label_tag :costlabel, access.cost, :class=>"control-label" %> <%= label_tag :costlabel2, "Euros", :class=>"control-label" %>
<% end %>
<%= submit_tag "Go" %>
<% end %>
私のコントローラーには次のものがあります:
helper_method :amount
def new
@amount = params[:cost]
end
mystuff/new のビューには次のような行があります。
<div class="row-fluid offset1">Stuff: <%= amount -%> </div>
エラー undefined method `amount' が表示されます。私がやりたいことは、ラジオ ボタンの値を次のビューに渡すことですが、データベースを使用したくありません。レールでそれを行う適切な方法は何ですか?