require 'polygallery' module Polygallery module StrongParamsHelper def self.polygallery_params(title=:gallery, photos_title=:photos) {:"#{title}_attributes" => [:id, :title, :galleryable_id, :galleryable_type, :_destroy, polyphoto_params(photos_title) ] } end def self.polyphoto_params(title=:photos) {:"#{title}_attributes" => [:id, :photo, :title, :caption, :gallery_title, :gallery_id, :galleryable_id, :galleryable_type, :_destroy] } end def polygallery_params(title=:gallery, photos_title=:photos) Polygallery::StrongParamsHelper.polygallery_params title, photos_title end def polyphoto_params(title=:photos) Polygallery::StrongParamsHelper.polyphoto_params title end end end