Adding a cover a image to blog

Marcos da Silva Ramos ms.ramos at outlook.com
Thu Sep 26 15:44:28 BRT 2013


Hello everyone,
I am Marcos Ramos and I study at University of Brasília. I'm on a project that is using Noosfero as its platform and I'm working along Paulo Meirelles and Valéssio Brito.
I need to put a 'cover' image into blogs. This cover will be displayed on the noosfero's homepage.
I've looked into the modules that already handles images, and i figure out that those classes are using 'acts_as_having_image', like 'models/project.rb', 'models/category.rb' (among others). A closer look into the database reveals that the corresponding tables have a field 'image_id' on they and that 'lib/acts_as_having_image.rb' expects the owner to have this field on its table.
I tried to run a migration to add the column 'image_id' to 'articles' table and it was succefull, however, when I run noosfero again it shows an error message whenever I try to create a new community or update the blog cover image (or anything that uses the Article classs):undefined method `image_id=' for #<Article::Version:0x7f502dc55240>
I figured out that Product and Category (they use acts_as_having_image) are direct children of ActiveRecord but the Blog class is not. It is a children of Folder (which is a children of Article). I suspect that this problem is related to the inheritance tree.
Also, I tried to use 'has_one', but then i had problems when updating a blog.
How could I properly put this image into a blog?
Thank you.,
Marcos da Silva Ramos 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listas.softwarelivre.org/pipermail/noosfero-dev/attachments/20130926/b714d744/attachment.html>


More information about the Noosfero-dev mailing list