Sha256: 952d8e8c98a9b8a7d59b94f86b65a7e042c92c06c2e00f336fb4a7519162b935
Contents?: true
Size: 785 Bytes
Versions: 34
Compression:
Stored size: 785 Bytes
Contents
module C80MapFloors module ApplicationHelper def render_map # map_settings = C80MapFloors::Setting.first # т.к. в json попадают строки вида # /home/scout/git/bitbucket/vorsa/public/uploads/map/map.jpg # извлечём эту строку, затем во вью обработаем её image_path p = Rails.root.join("public", "locations.json") locs = File.read(p) locs_hash = JSON.parse(locs) locs_hash["img"] = image_path(locs_hash["img"]) render :partial => 'c80_map_floors/map_row_index', :locals => { locs_hash: locs_hash, mapwidth: locs_hash["mapwidth"], mapheight: locs_hash["mapheight"] } end end end
Version data entries
34 entries across 34 versions & 1 rubygems