sorry for the newbie question: I have an app which has projects with different asset types (docs, videos, etc.) I’d like to add another asset for audio with identical functionality to the video one. Is there a way I can easily duplicate model/controller/view/table changing ‘video(s)’ to ‘audio(s)’?
Share
You can write a
ModuleusingActiuveSupport::Convernthat contains all the methods you need in the model then you canincludethe Module in the models to extend the models with the methods contained in your Module. Like This:Then in Model simply include your Module. For the views you can use Partials and give them the object via the
objectandasoptions like this:Then in the Partial you cann access the object given using the variable
data.