beast论坛建主题出现问题 求帮忙

ArgumentError in ForumsController#create
wrong number of arguments (2 for 0)
RAILS_ROOT: E:/Users/zhangyinghao/Desktop/beast/beast-1.0

Application Trace | Framework Trace | Full Trace
E:/Users/zhangyinghao/Desktop/beast/beast-1.0/vendor/plugins/white_list_formatted_content/init.rb:23:in initialize' E:/Users/zhangyinghao/Desktop/beast/beast-1.0/vendor/plugins/white_list_formatted_content/init.rb:23:innew' E:/Users/zhangyinghao/Desktop/beast/beast-1.0/vendor/plugins/white_list_formatted_content/init.rb:23:in body_html_with_formatting' E:/Users/zhangyinghao/Desktop/beast/beast-1.0/vendor/plugins/white_list_formatted_content/init.rb:18:informat_content'
E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in send'
E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:178:in
evaluate_method'
E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:166:in call'
E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:93:in
run'
E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in each'
E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in
send'
E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:92:in run'
E:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/callbacks.rb:276:in
run_callbacks'
E:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:344:in callback'
E:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:249:in
create_or_update'
E:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2555:in save_without_validation!'
E:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1088:in
save_without_dirty!'
-e:2:in `load'
-e:2
Request
Parameters:

{"forum"=>{"name"=>"321321321",
"description"=>"321321321",
"position"=>"321321321"},
"commit"=>"Create"}

Show session dump


Response
Headers:

{"Content-Type"=>"",
"Cache-Control"=>"no-cache"}

我的环境是ruby 1.8.6 rails 2.3.5 beast 1.0 db pg8.2 RedCloth 4.2.2

下面是插件white_list_formatted_content
ActiveRecord::Base.class_eval do
include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper
def self.format_attribute(attr_name)
class < < self; include ActionView::Helpers::TagHelper, ActionView::Helpers::TextHelper, WhiteListHelper; end
define_method(:body) { read_attribute attr_name }
define_method(:body_html) { read_attribute "#{attr_name}_html" }
define_method(:body_html=) { |value| write_attribute "#{attr_name}_html", value }
before_save :format_content
end

def dom_id
[self.class.name.downcase.pluralize.dasherize, id] * '-'
end

protected
def format_content
body.strip! if body.respond_to?(:strip!)
self.body_html = body.blank? ? '' : body_html_with_formatting
end

def body_html_with_formatting 
  body_html = auto_link body { |text| truncate(text, 50) } 
  textilized = RedCloth.new(body_html, [ :hard_breaks ]) 
  textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=") 
  white_list(textilized.to_html) 
end 

end

换RedCloth3
[code="ruby"]gem install RedCloth -v 3.0.4[/code]

见我的BLOG
[url]http://southwolf.iteye.com/blog/588491[/url]

帮你顶吧,描述的还是少了点