nobosh
2010-Sep-21 20:13 UTC
Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Hello, I''m working to install the acts_as_commentable plugin on my Rails 3 app. After adding "acts_as_commentable" to my book model, I then added a comment form on my book show view: <% form_for(@comment) do|f| %> <%= f.hidden_field :book_id %> <%= f.label :comment %><br /> <%= f.text_area :comment %> <%= f.submit "Post Comment" %> <% end %> Then in the controller (comments_controller.rb), def create @comment = Comment.new(params[:comment]) Book.comments.create(:title => "First comment.", :comment => "This is the first comment.") end Then when submitting a comment, it returns the error: "unknown attribute: book_id" From the log: Processing by CommentsController#create as HTML Parameters: {"comment"=>{"comment"=>"WOOOW", "book_id"=>"32"}, "commit"=>"Post Comment", "authenticity_token"=>"5YbtEMpoQL1e9coAIJBOm0WD55vB2XRZMJa4MMAR1YI=", "utf8"=>"✓"} Completed in 11ms ActiveRecord::UnknownAttributeError (unknown attribute: book_id): app/controllers/comments_controller.rb:3:in `new'' app/controllers/comments_controller.rb:3:in `create'' Suggestions? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-21 20:24 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
i made an example app for kelp kelp , it has threaded comments and polymorphic associations, tested on rails 3, you can see it at http://github.com/rbritom/Simple_polymorphic_nested_comments watch the code and do it your self, i think is better than using that gem, since is really easy to achieve with out the gem. I added lots of comments so that you can understand whats going and added some ajax, if you need more explanations just ask. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-21 20:43 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Thanks, that looks interesting and helpful... Couple comments: What is lft rgt for in the database? Also, proyects should be spelled projects.... Does nesting currently work is are you still working on implementing it? I''d still be interested in knowing y I''m hitting the bug above, any ideas? On Sep 21, 1:24 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i made an example app for kelp kelp , it has threaded comments and > polymorphic associations, tested on rails 3, you can see it at > > http://github.com/rbritom/Simple_polymorphic_nested_comments > > watch the code and do it your self, i think is better than using that gem, > since is really easy to achieve with out the gem. > > I added lots of comments so that you can understand whats going and added > some ajax, if you need more explanations just ask.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-21 20:49 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
oh , awsome nested set gem arrenges item like a tree , to is like root | ________|__________ left | item | right ______ |__ | ______|______ you see item has a left and right sibling, the gem saves , the parent_id of item , in this case root and the item of the item to the left and to the right -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-21 20:51 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
On Tue, Sep 21, 2010 at 4:49 PM, radhames brito <rbritom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> oh , awesome nested set gem arranges item like a tree , to is like > > > root > | > ________|__________ > left | item | right > ______ |__ | ______|______ > > > > you see item has a left and right sibling, the gem saves the parent_id > of the item , in this case root and the id of the item to the left and to > the right > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-21 22:52 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Very interesting, new to me... Does nesting currently work in your example app OR are you still working on implementing it? I''m trying to decide if nesting isn''t yet done, if I should wait until it''s up and working? On Sep 21, 1:49 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> oh , awsome nested set gem arrenges item like a tree , to is like > > root > | > ________|__________ > left | item | right > ______ |__ | ______|______ > > you see item has a left and right sibling, the gem saves , the parent_id > of item , in this case root and the item of the item to the left and to the > right-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 00:02 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
everything works it only lacks the comments On Tue, Sep 21, 2010 at 6:52 PM, nobosh <bhellman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Very interesting, new to me... > > Does nesting currently work in your example app OR are you still > working on implementing > it? I''m trying to decide if nesting isn''t yet done, if I should wait > until it''s up and working? > > On Sep 21, 1:49 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > oh , awsome nested set gem arrenges item like a tree , to is like > > > > root > > | > > ________|__________ > > left | item | right > > ______ |__ | ______|______ > > > > you see item has a left and right sibling, the gem saves , the > parent_id > > of item , in this case root and the item of the item to the left and to > the > > right > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 00:03 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
im going to update in 5 minutes , i added ajax pagination On Tue, Sep 21, 2010 at 8:02 PM, radhames brito <rbritom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> everything works it only lacks the comments > > > On Tue, Sep 21, 2010 at 6:52 PM, nobosh <bhellman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> Very interesting, new to me... >> >> Does nesting currently work in your example app OR are you still >> working on implementing >> it? I''m trying to decide if nesting isn''t yet done, if I should wait >> until it''s up and working? >> >> On Sep 21, 1:49 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> > oh , awsome nested set gem arrenges item like a tree , to is like >> > >> > root >> > | >> > ________|__________ >> > left | item | right >> > ______ |__ | ______|______ >> > >> > you see item has a left and right sibling, the gem saves , the >> parent_id >> > of item , in this case root and the item of the item to the left and to >> the >> > right >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Ruby on Rails: Talk" group. >> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >> . >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> >> >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 00:10 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
In 15 minutes im going to add ajax to the destroy action and a loading gif On Tue, Sep 21, 2010 at 8:03 PM, radhames brito <rbritom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> im going to update in 5 minutes , i added ajax pagination > > > On Tue, Sep 21, 2010 at 8:02 PM, radhames brito <rbritom-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> everything works it only lacks the comments >> >> >> On Tue, Sep 21, 2010 at 6:52 PM, nobosh <bhellman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>> Very interesting, new to me... >>> >>> Does nesting currently work in your example app OR are you still >>> working on implementing >>> it? I''m trying to decide if nesting isn''t yet done, if I should wait >>> until it''s up and working? >>> >>> On Sep 21, 1:49 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> > oh , awsome nested set gem arrenges item like a tree , to is like >>> > >>> > root >>> > | >>> > ________|__________ >>> > left | item | right >>> > ______ |__ | ______|______ >>> > >>> > you see item has a left and right sibling, the gem saves , the >>> parent_id >>> > of item , in this case root and the item of the item to the left and to >>> the >>> > right >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "Ruby on Rails: Talk" group. >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >>> To unsubscribe from this group, send email to >>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/rubyonrails-talk?hl=en. >>> >>> >> >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-22 00:17 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Nice can''t wait to try it out... Why not turn this into a Rails 3 Gem / plugin? On Sep 21, 5:10 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> In 15 minutes im going to add ajax to the destroy action and a loading gif > > > > On Tue, Sep 21, 2010 at 8:03 PM, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > im going to update in 5 minutes , i added ajax pagination > > > On Tue, Sep 21, 2010 at 8:02 PM, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> everything works it only lacks the comments > > >> On Tue, Sep 21, 2010 at 6:52 PM, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>> Very interesting, new to me... > > >>> Does nesting currently work in your example app OR are you still > >>> working on implementing > >>> it? I''m trying to decide if nesting isn''t yet done, if I should wait > >>> until it''s up and working? > > >>> On Sep 21, 1:49 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >>> > oh , awsome nested set gem arrenges item like a tree , to is like > > >>> > root > >>> > | > >>> > ________|__________ > >>> > left | item | right > >>> > ______ |__ | ______|______ > > >>> > you see item has a left and right sibling, the gem saves , the > >>> parent_id > >>> > of item , in this case root and the item of the item to the left and to > >>> the > >>> > right > > >>> -- > >>> You received this message because you are subscribed to the Google Groups > >>> "Ruby on Rails: Talk" group. > >>> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > >>> To unsubscribe from this group, send email to > >>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscrib e@googlegroups.com> > >>> . > >>> For more options, visit this group at > >>>http://groups.google.com/group/rubyonrails-talk?hl=en.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 00:50 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
ill think about it, i have never done one before. On Tue, Sep 21, 2010 at 8:17 PM, nobosh <bhellman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Nice can''t wait to try it out... Why not turn this into a Rails 3 > Gem / plugin? > > On Sep 21, 5:10 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > In 15 minutes im going to add ajax to the destroy action and a loading > gif > > > > > > > > On Tue, Sep 21, 2010 at 8:03 PM, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > im going to update in 5 minutes , i added ajax pagination > > > > > On Tue, Sep 21, 2010 at 8:02 PM, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > >> everything works it only lacks the comments > > > > >> On Tue, Sep 21, 2010 at 6:52 PM, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > >>> Very interesting, new to me... > > > > >>> Does nesting currently work in your example app OR are you still > > >>> working on implementing > > >>> it? I''m trying to decide if nesting isn''t yet done, if I should wait > > >>> until it''s up and working? > > > > >>> On Sep 21, 1:49 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >>> > oh , awsome nested set gem arrenges item like a tree , to is like > > > > >>> > root > > >>> > | > > >>> > ________|__________ > > >>> > left | item | > right > > >>> > ______ |__ | ______|______ > > > > >>> > you see item has a left and right sibling, the gem saves , the > > >>> parent_id > > >>> > of item , in this case root and the item of the item to the left > and to > > >>> the > > >>> > right > > > > >>> -- > > >>> You received this message because you are subscribed to the Google > Groups > > >>> "Ruby on Rails: Talk" group. > > >>> To post to this group, send email to > rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > >>> To unsubscribe from this group, send email to > > >>> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org><rubyonrails-talk%2Bunsubscrib > e@googlegroups.com> > > >>> . > > >>> For more options, visit this group at > > >>>http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 01:16 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
check it out i cant think of any more features to add. See if you can think of something =D -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-22 02:57 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
Very nice thanks, I''m trying it out now. don''t really have the need for pagination but it''s helpful as a learning tool/tutorial of sorts... regarding a feature to add, I can actually think of one very common feature, as seen on Facebook. If you have over 3 comments, to only show the latest 2 comments, and then have a ajax link "View all X comments" which when clicked loads/injects the remaining comments into the comment list. That''s a pretty important one! A less important one, is being able to LIKE a comment. Sound interesting? On Sep 21, 6:16 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> check it out i cant think of any more features to add. See if you can think > of something =D-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-22 03:55 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
To get your code working in my app I needed to: @comments = @article.comments.roots.order("created_at DESC").paginate( :page => params[:page]||1,:per_page => 5) REMOVE roots in books_controller.rb: @comments = @article.comments.order("created_at DESC").paginate( :page => params[:page]||1,:per_page => 5) And in comment.rb: COMMENT OUT #acts_as_nested_set Otherwise I get the error on the books show page: "uninitialized constant Book::Comment" Is there a GEM that needs to be installed? Or maybe this isn''t supported for Rails 3? On Sep 21, 7:57 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Very nice thanks, I''m trying it out now. > > don''t really have the need for pagination but it''s helpful as a > learning tool/tutorial of sorts... > > regarding a feature to add, I can actually think of one very common > feature, as seen on Facebook. If you have over 3 comments, to only > show the latest 2 comments, and then have a ajax link "View all X > comments" which when clicked loads/injects the remaining comments into > the comment list. That''s a pretty important one! A less important one, > is being able to LIKE a comment. > > Sound interesting? > > On Sep 21, 6:16 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > check it out i cant think of any more features to add. See if you can think > > of something =D-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-22 04:03 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
It would also be create if def create @comment = @commentable.comments.build(params[:comment]) Passed along the current_user as I added user_id to the comments table :) On Sep 21, 8:55 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> To get your code working in my app I needed to: > @comments = @article.comments.roots.order("created_at > DESC").paginate( :page => params[:page]||1,:per_page => 5) > REMOVE roots in books_controller.rb: > @comments = @article.comments.order("created_at DESC").paginate( :page > => params[:page]||1,:per_page => 5) > > And in comment.rb: > COMMENT OUT #acts_as_nested_set > > Otherwise I get the error on the books show page: "uninitialized > constant Book::Comment" > > Is there a GEM that needs to be installed? Or maybe this isn''t > supported for Rails 3? > > On Sep 21, 7:57 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Very nice thanks, I''m trying it out now. > > > don''t really have the need for pagination but it''s helpful as a > > learning tool/tutorial of sorts... > > > regarding a feature to add, I can actually think of one very common > > feature, as seen on Facebook. If you have over 3 comments, to only > > show the latest 2 comments, and then have a ajax link "View all X > > comments" which when clicked loads/injects the remaining comments into > > the comment list. That''s a pretty important one! A less important one, > > is being able to LIKE a comment. > > > Sound interesting? > > > On Sep 21, 6:16 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > check it out i cant think of any more features to add. See if you can think > > > of something =D-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 10:42 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
oohh very good ones , ill surely put them On Tue, Sep 21, 2010 at 10:57 PM, nobosh <bhellman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Very nice thanks, I''m trying it out now. > > don''t really have the need for pagination but it''s helpful as a > learning tool/tutorial of sorts... > > regarding a feature to add, I can actually think of one very common > feature, as seen on Facebook. If you have over 3 comments, to only > show the latest 2 comments, and then have a ajax link "View all X > comments" which when clicked loads/injects the remaining comments into > the comment list. That''s a pretty important one! A less important one, > is being able to LIKE a comment. > > Sound interesting? > > On Sep 21, 6:16 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > check it out i cant think of any more features to add. See if you can > think > > of something =D > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 10:45 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
well i left that out because it would make the example a little harder to follow what i will do is a second example that will integrate users, then one with users and captcha, i will add funcionality on topp of the existing one but as a new project so is easy to learn what''s news On Wed, Sep 22, 2010 at 12:03 AM, nobosh <bhellman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It would also be create if > > def create > @comment = @commentable.comments.build(params[:comment]) > > Passed along the current_user as I added user_id to the comments > table :) > > On Sep 21, 8:55 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > To get your code working in my app I needed to: > > @comments = @article.comments.roots.order("created_at > > DESC").paginate( :page => params[:page]||1,:per_page => 5) > > REMOVE roots in books_controller.rb: > > @comments = @article.comments.order("created_at DESC").paginate( :page > > => params[:page]||1,:per_page => 5) > > > > And in comment.rb: > > COMMENT OUT #acts_as_nested_set > > > > Otherwise I get the error on the books show page: "uninitialized > > constant Book::Comment" > > > > Is there a GEM that needs to be installed? Or maybe this isn''t > > supported for Rails 3? > > > > On Sep 21, 7:57 pm, nobosh <bhellm...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > Very nice thanks, I''m trying it out now. > > > > > don''t really have the need for pagination but it''s helpful as a > > > learning tool/tutorial of sorts... > > > > > regarding a feature to add, I can actually think of one very common > > > feature, as seen on Facebook. If you have over 3 comments, to only > > > show the latest 2 comments, and then have a ajax link "View all X > > > comments" which when clicked loads/injects the remaining comments into > > > the comment list. That''s a pretty important one! A less important one, > > > is being able to LIKE a comment. > > > > > Sound interesting? > > > > > On Sep 21, 6:16 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > check it out i cant think of any more features to add. See if you can > think > > > > of something =D > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 10:48 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
the projet is done i rails three and the awesome nested set is in there as a plug in, is what does the nesting, if you dont use it the nesting wont work, can you give me more info on you book model? i want know why is not working -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-22 15:56 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
On Sep 22, 3:48 am, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> the projet is done i rails three and the awesome nested set is in there as a > plug in, is what does the nesting, if you dont use it the nesting wont work, > can you give me more info on you book model? i want know why is not workingIs the plug-in in the GEM file? I''m not seeing it. Could you point it out so I can add it to my GEM file? If the plugin isn''t via the GEM file, how do you get it added to the rails 3 app? Thanks! -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 17:57 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
no , plugins go along with the rails app. gems get installed in the computer your are using and if you take your rails app somewhere else you have to install all the gems in that other computer, plugins install in the /vendor/plugin folder in the rails app and they go where ever you app goes, the result is almost the same but , gems are better if you have several project using something common, for example , most rails app use will_paginate so is better to install it as a gem on the pc, if you install will paginate as a plugin you would have a copy of will_paginate in each app, and also your app would grow as you put plugins in them. At then i installed awesome nested set as a plugin in the vendors/plugin directory because i needed to hack it, is not a good idea to hack a gem as gems as i explained are shared by all the apps in that computer. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-22 17:59 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
I was able to use gem ''nested_set'' Which got it working, now I just need to understand the rlt, lft stuff. Thanks - this is great! Looking forward to seeing the updates on the suggestions above. On Sep 22, 10:57 am, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> no , plugins go along with the rails app. gems get installed in the computer > your are using and if you take your rails app somewhere else you have to > install all the gems in that other computer, plugins install in the > /vendor/plugin folder in the rails app and they go where ever you app goes, > the result is almost the same but , gems are better if you have several > project using something common, for example , most rails app use > will_paginate so is better to install it as a gem on the pc, if you install > will paginate as a plugin you would have a copy of will_paginate in each > app, and also your app would grow as you put plugins in them. > > At then i installed awesome nested set as a plugin in the vendors/plugin > directory because i needed to hack it, is not a good idea to hack a gem as > gems as i explained are shared by all the apps in that computer.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-22 20:10 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
i havent have time to add all the commentaries to the code, i just hop is useful -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
nobosh
2010-Sep-22 23:47 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
It was incredibly helpful and your commenting was awesome. It''s rare to see such nice commenting in 2 languages! Thank you!!! On Sep 22, 1:10 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> i havent have time to add all the commentaries to the code, i just hop is > useful-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-23 01:23 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
And it still needs more commenting 2010/9/22, nobosh <bhellman1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> It was incredibly helpful and your commenting was awesome. It''s rare > to see such nice commenting in 2 languages! Thank you!!! > > On Sep 22, 1:10 pm, radhames brito <rbri...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> i havent have time to add all the commentaries to the code, i just hop is >> useful > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- Enviado desde mi dispositivo móvil -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Sep-23 14:21 UTC
Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
nobosh wrote:> I was able to use > gem ''nested_set'' > Which got it working, now I just need to understand the rlt, lft > stuff.http://dev.mysql.com/tech-resources/articles/hierarchical-data.html Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-23 15:48 UTC
Re: Re: Working in install acts_as_commentable, On create, error: "unknown attribute: book_id"
awesome link marnen On Thu, Sep 23, 2010 at 10:21 AM, Marnen Laibow-Koser <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org>wrote:> nobosh wrote: > > I was able to use > > gem ''nested_set'' > > Which got it working, now I just need to understand the rlt, lft > > stuff. > > http://dev.mysql.com/tech-resources/articles/hierarchical-data.html > > Best, > -- > Marnen Laibow-Koser > http://www.marnen.org > marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Reasonably Related Threads
- Rails Commenting, Plugins?
- Rails 3 - Creating a comment and then returning the Partial with JUST the new comment
- Adding a selected checkbox to a new nested model without polluting the model
- Paperclip not executing FFMPEG properly
- How to transform my html form into a rails 3 form