# ActionView::TemplateError (undefined method \`comment\_count='

**URL:** <https://www.ruby-forum.com/t/actionview-templateerror-undefined-method-comment-count/158554>\
**Category:** Deployment\
**Created:** [January 24, 2009, 8:31pm UTC](https://www.ruby-forum.com/t/actionview-templateerror-undefined-method-comment-count/158554 "2009-01-24T20:31:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajahm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@rajahm](https://www.ruby-forum.com/u/rajahm)\
**Post date:** [January 24, 2009, 8:31pm UTC](https://www.ruby-forum.com/t/actionview-templateerror-undefined-method-comment-count/158554/1 "2009-01-24T20:31:29Z")

</div>

Hello,

I am using Facebooker RoR plug-in.

Following code used to work but suddenly I am getting an error which I  
am not able to decipher. Any help is appreciated

Thanks  
Rajan

ActionView::TemplateError (undefined method `comment\_count=’ for  
#\<Facebooker::User::Status:0xb6c382bc @message={}, @time=“0”\>) on line  
#3 of meetings/list.fbml.erb:  
1:

  
2: 
# 3: Hi \<%= @current\_facebook\_user.first\_name %\>, Welcome to trymeet. 4:
  
5: 
  
6:

---

<div class="post-metadata">

**Author:** ![rajahm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@rajahm](https://www.ruby-forum.com/u/rajahm)\
**Post date:** [January 25, 2009, 1:24am UTC](https://www.ruby-forum.com/t/actionview-templateerror-undefined-method-comment-count/158554/2 "2009-01-25T01:24:53Z")

</div>

I had exactly the same problem. Infact, this occours from time to time  
with various field-names.

Solution:  
Open vendor/plugins/facebooker/lib/facebooker/models/user.rb and add the  
“comment\_count”-field to the attr\_accessor-list (should be in line 12).  
It should look like:

attr\_accessor :message, :time, :status\_id, :comment\_count

Here is a link to a bug-report to a related problem some month ago (with  
the same solution):  
[http://rubyforge.org/tracker/index.php?func=detail&aid=23004&group\_id=4187&atid=16132](http://rubyforge.org/tracker/index.php?func=detail&aid=23004&group_id=4187&atid=16132)

---

<div class="post-metadata">

**Author:** ![rajahm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@rajahm](https://www.ruby-forum.com/u/rajahm)\
**Post date:** [January 26, 2009, 12:59pm UTC](https://www.ruby-forum.com/t/actionview-templateerror-undefined-method-comment-count/158554/3 "2009-01-26T12:59:03Z")

</div>

Have updated the User/Status class to include the extra filed as  
described above but am still receiving an invlaid parameter error. Was  
this definitly the solution to the problem…?

thanks,

Damo

Ma MÃ¼ wrote:

> I had exactly the same problem. Infact, this occours from time to time  
> with various field-names.
> 
> Solution:  
> Open vendor/plugins/facebooker/lib/facebooker/models/user.rb and add the  
> “comment\_count”-field to the attr\_accessor-list (should be in line 12).  
> It should look like:
> 
> attr\_accessor :message, :time, :status\_id, :comment\_count
> 
> Here is a link to a bug-report to a related problem some month ago (with  
> the same solution):  
> [http://rubyforge.org/tracker/index.php?func=detail&aid=23004&group\_id=4187&atid=16132](http://rubyforge.org/tracker/index.php?func=detail&aid=23004&group_id=4187&atid=16132)

---

<div class="post-metadata">

**Author:** ![rajahm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@rajahm](https://www.ruby-forum.com/u/rajahm)\
**Post date:** [January 26, 2009, 1:13pm UTC](https://www.ruby-forum.com/t/actionview-templateerror-undefined-method-comment-count/158554/4 "2009-01-26T13:13:45Z")

</div>

Are you sure you edited the correct line and restarted your app? Sorry I  
know this is obvious, but I don’t what else could cause the problem.  
After these changes it’s working like a charm for me.

```auto
require 'facebooker/model'
require 'facebooker/models/affiliation'
require 'facebooker/models/work_info'
require 'active_support'
module Facebooker
  #
  # Holds attributes and behavior for a Facebook User
  class User
    include Model
    class Status
      include Model
      attr_accessor :message, :time, :status_id, :comment_count # <-- 
EDIT HERE
    end
    FIELDS = ...
```

---

<div class="post-metadata">

**Author:** ![rajahm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@rajahm](https://www.ruby-forum.com/u/rajahm)\
**Post date:** [January 26, 2009, 5:29pm UTC](https://www.ruby-forum.com/t/actionview-templateerror-undefined-method-comment-count/158554/5 "2009-01-26T17:29:25Z")

</div>

Restarting mongrel worked.

thanks for your help Ma Mu

best

Damo

Ma MÃ¼ wrote:

> Are you sure you edited the correct line and restarted your app? Sorry I  
> know this is obvious, but I don’t what else could cause the problem.  
> After these changes it’s working like a charm for me.
> 
> ```auto
> require 'facebooker/model'
> > require 'facebooker/models/affiliation'
> > require 'facebooker/models/work_info'
> > require 'active_support'
> > module Facebooker
> > #
> > # Holds attributes and behavior for a Facebook User
> > class User
> > include Model
> > class Status
> > include Model
> > attr_accessor :message, :time, :status_id, :comment_count # <-- 
> > EDIT HERE
> > end
> > FIELDS = ...
> ```

---

<div class="post-metadata">

**Author:** ![rajahm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/9d8465/32.png) [@rajahm](https://www.ruby-forum.com/u/rajahm)\
**Post date:** [January 26, 2009, 6:38pm UTC](https://www.ruby-forum.com/t/actionview-templateerror-undefined-method-comment-count/158554/6 "2009-01-26T18:38:25Z")

</div>

Ma MÃ¼ wrote:

> I had exactly the same problem. Infact, this occours from time to time  
> with various field-names.
> 
> Solution:  
> Open vendor/plugins/facebooker/lib/facebooker/models/user.rb and add the  
> “comment\_count”-field to the attr\_accessor-list (should be in line 12).  
> It should look like:
> 
> attr\_accessor :message, :time, :status\_id, :comment\_count
> 
> Here is a link to a bug-report to a related problem some month ago (with  
> the same solution):  
> [http://rubyforge.org/tracker/index.php?func=detail&aid=23004&group\_id=4187&atid=16132](http://rubyforge.org/tracker/index.php?func=detail&aid=23004&group_id=4187&atid=16132)

Thanks a lot Ma Mu…I appreciate it. Your solution did work…  
Please correct me here, This code just worked before day back and  
started giving this trouble. Is it because Facebooker plug-in is  
evolving…

Thanks for insight and quick response Have a good day.

Regards  
Rajan B.
