0

我正在关注 Rails 的介绍:http: //guides.rubyonrails.org/getting_started.html#creating-new-posts

并且我希望能够将数据添加到我的表单中,这些数据没有在字段中选择,只是作为常量传递。

我怎么做?

4

1 回答 1

2

<%= f.hidden_field :name, :value => value %>

请参阅ActionView::Helpers::FormHelper

于 2011-06-11T10:30:30.330 回答