Forum: Rails deployment ActionView::TemplateError (undefined method `comment_count='

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5b307196cc3edd69b1a3c0efee13f965?d=identicon&s=25 Rajan Bhatt (rajahm)
on 2009-01-24 20:31
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: <div style="padding-left: 10px; padding-top:10px;">
2: <h1>
3: Hi <%= @current_facebook_user.first_name %>, Welcome to trymeet.
4: </h1>
5: </div>
6:
2e8a7f9d6b81eb09628815eaefb28818?d=identicon&s=25 Ma Mü (malte)
on 2009-01-25 01:24
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...
5fdc0120c81049f7a79def7b35d8fed3?d=identicon&s=25 Damian Mitchell (damo)
on 2009-01-26 12:59
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...
2e8a7f9d6b81eb09628815eaefb28818?d=identicon&s=25 Ma Mü (malte)
on 2009-01-26 13:13
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.

[code]
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 = ...
[/code]
5fdc0120c81049f7a79def7b35d8fed3?d=identicon&s=25 Damian Mitchell (damo)
on 2009-01-26 17:29
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.
>
> [code]
> 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 = ...
> [/code]
5b307196cc3edd69b1a3c0efee13f965?d=identicon&s=25 Rajan Bhatt (rajahm)
on 2009-01-26 18:38
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...

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 Bhatt
This topic is locked and can not be replied to.