I am doing some pagination and can do @next_images_to_paginate += 4
without a problem.
But @previous_images_to_paginate -= 4
doesn't because I can get negative numbers.
I can't use absolute because I want -1, -2 and -3 to be 0.
Something like:
((@previous_images_to_paginate -= 4) < 0) ? 0 : (@previous_images_to_paginate -= 4)
but I would like something less wordy.
The page being created is not appropriate for will_paginate
, etc.