Files
old-ribica/front-api/controllers/common_for_controllers.rb

14 lines
309 B
Ruby
Raw Normal View History

2015-02-09 22:22:33 +01:00
# converts querystring to hash
def get_querystring_hash()
Rack::Utils.parse_nested_query(request.query_string)
end
2015-01-22 06:38:48 +01:00
def add_total_count_header(total)
response.headers['X-Total-Count'] = total
end
2015-01-22 06:38:48 +01:00
# converts list of parameters to array of integers
def mass_to_i(*id_strings)
id_strings.map(&:to_i)
2015-02-09 22:22:33 +01:00
end