Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not Rails3 ready? #1

Open
millisami opened this issue Jul 2, 2010 · 5 comments
Open

Not Rails3 ready? #1

millisami opened this issue Jul 2, 2010 · 5 comments

Comments

@millisami
Copy link

Hi,
I tried to use this with rails3.beta.4 and its not compatible.
Is there any work in progress for rails3 compatibleness?

@keone
Copy link

keone commented Jan 23, 2011

I got it to work in rails3. The only thing I had to change was in the pfeed/init.rb file, I changed :object to :pfeed_item and made sure all of my individual pfeed item templates (the ones in view/pfeeds) referenced pfeed_item instead of referencing their individual name. (For instance, _user_updated_attribute.html.erb references the object user_updated_attribute, but you have to change it to pfeed_item otherwise it does not work.

   def pfeed_content(pfeed)
controller.send('render_to_string',
  :partial => "pfeeds/#{pfeed.view_template_name}.html.erb", :locals => {:pfeed_item => pfeed})
 end

@keone
Copy link

keone commented Jan 23, 2011

d'oh, spoke too soon. i'm also having problems; I get basic functionality "__ bought 37 minutes ago" but can't get it to use custom models/views. Everything gets routed through pfeed_item, and looking at the log it looks like this is because pfeed_item objects are always created (never the more specific descendants).

@keone
Copy link

keone commented Jan 23, 2011

okay. I got it to work.
My problem was that the specific object doing the action was an inherited class (Student , which inherits from User), even though the action (buy) was defined in the parent class (User). So pfeed was looking for Pfeeds::StudentBought, and when it couldn't find it, it just inserted type = NULL (i.e. PfeedItem) into the pfeed table.
Defining as student_bought model/view made it work.

Maybe your problem is similar? Anyway, hope this helps someone.

@ghost
Copy link

ghost commented Apr 28, 2011

i also have problem using pfeed with rails 3 and got solved by changing pfeed/init.rb

:partial => "pfeeds/#{pfeed.view_template_name}.html.erb",:object => pfeed)
just remove locals and it works you don't need to change view

@angelacode
Copy link

has anyone else been able to get it to work in Rails 3? Is the workaround described by naveedahmad the way to go?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants