# Problem with 'commentable'; was "Re: RadiantCMS, Maple Leaf

**URL:** <https://www.ruby-forum.com/t/problem-with-commentable-was-re-radiantcms-maple-leaf/76549>\
**Category:** Radiant CMS\
**Created:** [November 20, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/problem-with-commentable-was-re-radiantcms-maple-leaf/76549 "2006-11-20T14:46:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![robert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@robert](https://www.ruby-forum.com/u/robert)\
**Post date:** [November 20, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/problem-with-commentable-was-re-radiantcms-maple-leaf/76549/1 "2006-11-20T14:46:07Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

On 28-okt-2006, at 13:47, Sean C. wrote:

> It has that already, albeit a somewhat kludgy implementation. Check out Commentable on the wiki under ThirdPartyBehaviors.
> 
> Sean C.  
> [seancribbs.com](http://seancribbs.com)

Sean (or anyone),

I’m currently testing the commentable behavior. I added the files to  
the app/behaviors dir. Although the comment form appears as it  
should in an article page, but when I submit a comment I receive the  
below error (my apologies for the enormous amount of text, but I  
didn’t which part you’d need). The articles are set to ‘commentable’,  
the snippet was made and inserted in the layout with \<r:snippet  
name=“comments” /\>. I just working my way through “Programming Ruby”  
and “Agile web development …” so I’m quite new to Ruby (on Rails)  
and probably missing something simple…

+++++++++++++++++++++++++++++++++++++  
ActiveRecord::RecordInvalid in SiteController#show\_page

Validation failed: Status must be a number, Status must be a number

RAILS\_ROOT: script/…/config/…  
Application Trace | Framework Trace | Full Trace

vendor/rails/activerecord/lib/active\_record/validations.rb:748:in  
`save!' vendor/rails/activerecord/lib/active_record/validations.rb:711:in `create!’  
vendor/rails/activerecord/lib/active\_record/associations/  
has\_many\_association.rb:102:in `send' vendor/rails/activerecord/lib/active_record/associations/ has_many_association.rb:102:in `method\_missing’  
vendor/rails/activerecord/lib/active\_record/base.rb:873:in `with_scope' vendor/rails/activerecord/lib/active_record/associations/ has_many_association.rb:92:in `method\_missing’  
app/behaviors/comments\_util.rb:23:in `create_comment_in' app/behaviors/commentable_behavior.rb:34:in `process’  
#{RAILS\_ROOT}/lib/advanced\_delegation.rb:10:in `send' #{RAILS_ROOT}/lib/advanced_delegation.rb:10:in `process’  
app/controllers/site\_controller.rb:36:in `show_uncached_page' app/controllers/site_controller.rb:22:in `show\_page’

vendor/rails/activerecord/lib/active\_record/validations.rb:748:in  
`save!' vendor/rails/activerecord/lib/active_record/validations.rb:711:in `create!’  
vendor/rails/activerecord/lib/active\_record/associations/  
has\_many\_association.rb:102:in `send' vendor/rails/activerecord/lib/active_record/associations/ has_many_association.rb:102:in `method\_missing’  
vendor/rails/activerecord/lib/active\_record/base.rb:873:in `with_scope' vendor/rails/activerecord/lib/active_record/associations/ has_many_association.rb:92:in `method\_missing’  
vendor/rails/actionpack/lib/action\_controller/base.rb:941:in `send' vendor/rails/actionpack/lib/action_controller/base.rb:941:in `perform\_action\_without\_filters’  
vendor/rails/actionpack/lib/action\_controller/filters.rb:368:in  
`perform_action_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in `perform\_action\_without\_rescue’  
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in `perform\_action\_without\_rescue’  
vendor/rails/actionpack/lib/action\_controller/rescue.rb:82:in  
`perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:408:in `send’  
vendor/rails/actionpack/lib/action\_controller/base.rb:408:in  
`process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:377:in `process\_without\_session\_management\_support’  
vendor/rails/actionpack/lib/action\_controller/session\_management.rb:  
117:in `process' vendor/rails/railties/lib/dispatcher.rb:38:in `dispatch’  
vendor/rails/railties/lib/webrick\_server.rb:115:in `handle_dispatch' vendor/rails/railties/lib/webrick_server.rb:81:in `service’  
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run’  
/usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start’  
vendor/rails/railties/lib/webrick\_server.rb:67:in `dispatch' vendor/rails/railties/lib/commands/servers/webrick.rb:59 vendor/rails/activesupport/lib/active_support/dependencies.rb:147:in `require’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:147:in  
`require' vendor/rails/railties/lib/commands/server.rb:30 script/server:3:in `require’  
script/server:3

vendor/rails/activerecord/lib/active\_record/validations.rb:748:in  
`save!' vendor/rails/activerecord/lib/active_record/validations.rb:711:in `create!’  
vendor/rails/activerecord/lib/active\_record/associations/  
has\_many\_association.rb:102:in `send' vendor/rails/activerecord/lib/active_record/associations/ has_many_association.rb:102:in `method\_missing’  
vendor/rails/activerecord/lib/active\_record/base.rb:873:in `with_scope' vendor/rails/activerecord/lib/active_record/associations/ has_many_association.rb:92:in `method\_missing’  
app/behaviors/comments\_util.rb:23:in `create_comment_in' app/behaviors/commentable_behavior.rb:34:in `process’  
#{RAILS\_ROOT}/lib/advanced\_delegation.rb:10:in `send' #{RAILS_ROOT}/lib/advanced_delegation.rb:10:in `process’  
app/controllers/site\_controller.rb:36:in `show_uncached_page' app/controllers/site_controller.rb:22:in `show\_page’  
vendor/rails/actionpack/lib/action\_controller/base.rb:941:in `send' vendor/rails/actionpack/lib/action_controller/base.rb:941:in `perform\_action\_without\_filters’  
vendor/rails/actionpack/lib/action\_controller/filters.rb:368:in  
`perform_action_without_benchmark' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in `perform\_action\_without\_rescue’  
/usr/local/lib/ruby/1.8/benchmark.rb:293:in `measure' vendor/rails/actionpack/lib/action_controller/benchmarking.rb:69:in `perform\_action\_without\_rescue’  
vendor/rails/actionpack/lib/action\_controller/rescue.rb:82:in  
`perform_action' vendor/rails/actionpack/lib/action_controller/base.rb:408:in `send’  
vendor/rails/actionpack/lib/action\_controller/base.rb:408:in  
`process_without_filters' vendor/rails/actionpack/lib/action_controller/filters.rb:377:in `process\_without\_session\_management\_support’  
vendor/rails/actionpack/lib/action\_controller/session\_management.rb:  
117:in `process' vendor/rails/railties/lib/dispatcher.rb:38:in `dispatch’  
vendor/rails/railties/lib/webrick\_server.rb:115:in `handle_dispatch' vendor/rails/railties/lib/webrick_server.rb:81:in `service’  
/usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service' /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run’  
/usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread' /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each' /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start’  
/usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start' /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start’  
vendor/rails/railties/lib/webrick\_server.rb:67:in `dispatch' vendor/rails/railties/lib/commands/servers/webrick.rb:59 vendor/rails/activesupport/lib/active_support/dependencies.rb:147:in `require’  
vendor/rails/activesupport/lib/active\_support/dependencies.rb:147:in  
`require' vendor/rails/railties/lib/commands/server.rb:30 script/server:3:in `require’  
script/server:3

Request

Parameters: {“name”=\>“robert”, “title”=\>“comment”, “body”=\>“this is a  
comment”, “url”=\>[“articles”, “2006”, “06”, “09”, “first-post”]}

Show session dump

* * *

Response  
Headers: {“cookie”=\>[]}  
+++++++++++++++++++++++++++++++++++++

Thanks,

Robert.

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFFQ09etKX8OBbKsDMRAskwAJ9FY+u75VUwpe21LBwlA20pNg7OLwCeJUmU  
PmAAIovTs30KxDaSsCSAMHw=  
=/VT6  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![robert](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@robert](https://www.ruby-forum.com/u/robert)\
**Post date:** [November 20, 2006, 2:46pm UTC](https://www.ruby-forum.com/t/problem-with-commentable-was-re-radiantcms-maple-leaf/76549/2 "2006-11-20T14:46:14Z")

</div>

Robert,

Add a “config” part to the pages on which it is failing and put this  
line in that part:

status: 1

That line with make all comments be posted in “Draft” mode. By the way,  
the proper way to install Commentable is as a plugin. Run this from the  
command line in the root of your Radiant application:

ruby script/plugin install  
[http://seancribbs.com/svn/rails/plugins/comments\_behaviors](http://seancribbs.com/svn/rails/plugins/comments_behaviors)

In the next few weeks I’ll be porting Commentable to the new sexy  
extensions system. So all you kids playing with the mental branch can  
have a new and improved Commentable!

Sean

p.s. If you continue to have problems with the behaviors, please email  
me privately.
