Forum: Ruby on Rails Small design problem

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.
Szymon N. (Guest)
on 2006-05-05 19:18
Hi,

I've got a page with galleries. Everything works quite ok. But now i
need to create a special gallery that will be used only to randomly
display images on the home page.

The main difference between this and the other galleries will be that it
won't have description and title like the others and its images won't
have their thumbnail versions. Admin won't be able to delete this
gallery or add new one of this type, he will only be able to add/remove
pictures.

How to do it? I don't want to change much code that i've written so far.
Should i just assume that gallery with id=1 is the special one and
everywhere else show galleries except the one with id=1? Maybe inherit
new class from the gallery class and just copy most of the code for
adding/removing pictures? Or use STI (but it would probably lead to most
code + database changes)?

Any suggestions?
This topic is locked and can not be replied to.