Sha256: d915038ff1e44edbd3abb6bd07abcf0925c6f3b8679f45af78201ebe73031c99
Contents?: true
Size: 824 Bytes
Versions: 10
Compression:
Stored size: 824 Bytes
Contents
# map locals and edit links links_data = [] opts.each do |_var_name, v| var_name = _var_name.to_s next unless tpl_data_relations[var_name] data = tpl_data_relations[var_name] #if class exists $modelDecorator #klass = Object.const_get "#{p['model']}CmsDecorator" #objDecorator = klass.new(v) #classify. modelEditDecorator = "#{data.data_model_name}CmsDecorator".safe_constantize.new(v) next unless modelEditDecorator link_edit = modelEditDecorator.edit_path next unless link_edit #p = tpl_data_relations[var_name] #id = v.send(:id) #links_edit << {link: send(p["root_edit"]+"_path", id)} link_html = link_to("edit #{data.title}", link_edit, target: "_blank") links_data << {link: link_edit, link_html: link_html} end
Version data entries
10 entries across 10 versions & 1 rubygems