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

Version Path
c80_map_floors-0.2.0.8 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.2.0.7 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.2.0.6 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.2.0.5 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.2.0.4 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.2.0.3 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.2.0.2 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.2.0.1 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.2.0.0 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.25 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.24 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.23 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.22 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.21 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.20 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.19 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.18 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.17 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.16 app/helpers/c80_map_floors/application_helper.rb
c80_map_floors-0.1.0.15 app/helpers/c80_map_floors/application_helper.rb