acts-as-commentable

Can I use Paperclip for comments in rails and how?

旧城冷巷雨未停 提交于 2019-12-25 04:37:07
问题 I want users to be able to comment on a post with an image or gif which Paperclip supports very well. How can i achieve that? Can it work with acts_as_commentable? 回答1: You can use wysiwyg-rails it's easier 来源: https://stackoverflow.com/questions/36607432/can-i-use-paperclip-for-comments-in-rails-and-how

How to use acts-as-commentable-with-threading in Rails

人走茶凉 提交于 2019-12-24 22:17:40
问题 I am developing my first rails site (yup, i am a rails idiot). I'm writing a blog, and i got to the comments part. I installed acts-as-commentable-with-threading ( GitHub ), i made and ran the migration like the install instructions said. I have added acts_as_commentable to my Posts model and i have a Comments controller When i add @comment = Comment.build_from(params[:id],1, params[:body] ) I get the error. undefined method `build_from' for # Clearly i am doing something terribly wrong, and

How to dynamically add routes in Rails 3.2

不问归期 提交于 2019-12-13 19:14:56
问题 I'm using acts_as_commentable in a Rails app to allow commenting on different types of models. I've got a polymorphic CommentsController ala the Polymorphic Association Railscast. I'm trying to write specs for this controller; however, I'd like to use acts_as_fu to define a generic Commentable class for the controller to use in the specs. This way its not tied to one of our concrete commentable models. The problem is that when I try to test the controller actions I get routing errors because

rails routing: nested resources with different namespace

偶尔善良 提交于 2019-12-08 03:31:20
问题 I am trying to use the acts_as_commentable GEM to add comments to my Post Model. I am using ABC as namespace, so all my controller and models named as ABC::Post, ABC::User, etc. Currently my routing setup is as following. namespace :abc do resources :post do resources :comments end end The routing URL generated is POST /abc/post/:id/comments(.:format) abc/comments#create How can i make it to POST /abc/post/:id/comments(.:format) /comments#create 回答1: founded the answer namespace :abc do

rails routing: nested resources with different namespace

帅比萌擦擦* 提交于 2019-12-06 21:55:44
I am trying to use the acts_as_commentable GEM to add comments to my Post Model. I am using ABC as namespace, so all my controller and models named as ABC::Post, ABC::User, etc. Currently my routing setup is as following. namespace :abc do resources :post do resources :comments end end The routing URL generated is POST /abc/post/:id/comments(.:format) abc/comments#create How can i make it to POST /abc/post/:id/comments(.:format) /comments#create founded the answer namespace :abc do resources :post do resources :comments, controller: '/comments' end end 来源: https://stackoverflow.com/questions