diff --git a/app/controllers/admin/communication/unsplash_controller.rb b/app/controllers/admin/communication/unsplash_controller.rb index b48411c31c323dc49df08905139553c061e64869..f3ecdc1479e1f2199f3108480e867f856889bf9d 100644 --- a/app/controllers/admin/communication/unsplash_controller.rb +++ b/app/controllers/admin/communication/unsplash_controller.rb @@ -9,10 +9,10 @@ class Admin::Communication::UnsplashController < Admin::Communication::Applicati else p = { query: params[:query], - page: (params[:page] || 1), - per_page: (params[:per_page] || 10), - orientation: (params[:orientation] || 'squarish'), - lang: (params[:lang] || 'en') + page: (params[:page].presence || 1), + per_page: (params[:per_page].presence || 10), + orientation: (params[:orientation].presence || 'squarish'), + lang: (params[:lang].presence || 'en') } @search = Unsplash::Search.search "/search/photos", Unsplash::Photo, p @total = @search.total