Module: Polygallery::StrongParamsHelper
- Defined in:
- lib/polygallery/strong_params_helper.rb
Class Method Summary collapse
- .polygallery_params(title = :gallery, photos_title = :photos) ⇒ Object
- .polyphoto_params(title = :photos) ⇒ Object
Instance Method Summary collapse
- #polygallery_params(title = :gallery, photos_title = :photos) ⇒ Object
- #polyphoto_params(title = :photos) ⇒ Object
Class Method Details
.polygallery_params(title = :gallery, photos_title = :photos) ⇒ Object
5 6 7 8 |
# File 'lib/polygallery/strong_params_helper.rb', line 5 def self.polygallery_params(title=:gallery, photos_title=:photos) {:"#{title}_attributes" => [:id, :title, :galleryable_id, :galleryable_type, :_destroy, polyphoto_params(photos_title) ] } end |
.polyphoto_params(title = :photos) ⇒ Object
9 10 11 12 13 |
# File 'lib/polygallery/strong_params_helper.rb', line 9 def self.polyphoto_params(title=:photos) {:"#{title}_attributes" => [:id, :photo, :photo_remote_url, :photo_to_upload, :title, :caption, :gallery_title, :gallery_id, :galleryable_id, :galleryable_type, :_destroy] } end |
Instance Method Details
#polygallery_params(title = :gallery, photos_title = :photos) ⇒ Object
14 15 |
# File 'lib/polygallery/strong_params_helper.rb', line 14 def polygallery_params(title=:gallery, photos_title=:photos) StrongParamsHelper.polygallery_params title, photos_title end |
#polyphoto_params(title = :photos) ⇒ Object
16 17 18 |
# File 'lib/polygallery/strong_params_helper.rb', line 16 def polyphoto_params(title=:photos) StrongParamsHelper.polyphoto_params title end |