I have a data structure like this in one of my models:
def image_size_limits
{
"web" => {"maxheight" => 480, "maxwidth" => 680, "minheight" => 400, "minwidth" => 600},
"phone" => {"height" => 345, "width" => 230, "minheight" => 300, "minwidth" => 200},
"tablet" => {"height" => 680, "width" => 480, "minheight" => 600, "minwidth" => 400},
"other" => {"height" => 680, "width" => 480, "minheight" => 600, "minwidth" => 400}
}
end
I use this in a custom validator I have to validate the sizes of images uploaded. I would like to be able to use this data structure not just in this one model - but everywhere. In all my models, views and controllers.
How would I go about doing that, where would I put it?