基本的な足場構造を使用しています。published
必要なのは、に変更して「中程度」のアクションとビューを追加することtrue
です。私の考えでは、moderate.htmlで、パラメータを変更して保存する機能を備えたすべての未公開エントリのリストを取得する必要があります。これが私のコードの一部です:
#names_controller.rb
def moderate
@name = Name.find(:all, :conditions => {:published => false} )
respond_to do |format|
format.html
format.xml
end
end
#moderate.html.erb
<% form_for @name.each do |f| %>
<%= f.error_messages %>
<%= f.text_field :which %>
<%= f.text_field :what %>
<%= f.check_box :published %>
<%= f.submit %>
</p>
<% end %>
代わりに、次のエラーが発生します。
NoMethodError in Names#moderate
Showing app/views/names/moderate.html.erb where line #1 raised:
undefined method `enumerable_enumerator_path' for #<ActionView::Base:0x1042c3e90>
Extracted source (around line #1)
それで、あなたは初心者を助けてくれますか?
ルビー1.8.7(2009-06-12パッチレベル174)
[universal-darwin10.0] Rails 2.3.5