我一直在尝试使用Semantic-UI构建菜单.我无法让下拉菜单工作.我拿了一份菜单示例页面的副本,然后拉出除分层菜单以外的所有内容,并将其放在一个单独的文件中.尽管没有错误,但只有下拉菜单才会起作用.谁能告诉我我错过了什么?
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Script-Type" content="text/jscript" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<link rel="stylesheet" type="text/css" class="ui" href="http://semantic-ui.com/build/packaged/css/semantic.min.css">
<link rel="stylesheet" type="text/css" href="http://semantic-ui.com/stylesheets/semantic.css">
<script src="http://semantic-ui.com/javascript/library/jquery.min.js"></script>
<script src="http://semantic-ui.com/javascript/library/history.js"></script>
<script src="http://semantic-ui.com/javascript/library/easing.js"></script>
<script src="http://semantic-ui.com/javascript/library/ace/ace.js"></script>
<script src="http://semantic-ui.com/javascript/library/tablesort.js"></script>
<script src="http://semantic-ui.com/javascript/library/waypoints.js"></script>
<script src="http://semantic-ui.com/build/packaged/javascript/semantic.min.js"></script>
<script src="http://semantic-ui.com/javascript/semantic.js"></script>
</head>
<body class="menu" >
<div class="ui tiered menu">
<div class="menu">
<a class="active item">
<i class="users icon"></i>
Friends
</a>
<a class="item">
<i class="grid layout icon"></i> Browse
</a>
<a class="item">
<i class="mail icon"></i> Messages
</a>
<div class="right menu">
<div class="item"> …Run Code Online (Sandbox Code Playgroud) 我的heroku toolbelt一直工作正常,直到上周,它给了我所有heroku命令的这个错误.
$ heroku run console -a abc
/Users/songserm/.local/share/heroku/client/bin/heroku: line 21: /Users/songserm/.local/share/heroku/client/bin/node: No such file or directory
/Users/songserm/.local/share/heroku/client/bin/heroku: line 21: /Users/songserm/.local/share/heroku/client/bin/node: No such file or directory
Run Code Online (Sandbox Code Playgroud)
我不知道我的heroku已经自动升级了,但是改变的是我安装了heroku-vi插件.不确定是不是这样.
有没有人见过这个问题?
注意到我使用自制软件在我的Mac上安装了heroku.
我想让用户将Word文档和PDF文件上传到我的rails应用程序.我的应用程序类似于Pinterest应用程序,用户可以创建Pins,其中附加图片后跟描述(使用Paperclip将图像附加到Pin).
这是我的Pins模型:
class Pin < ActiveRecord::Base
belongs_to :user
has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" }
validates_attachment :image, content_type: { content_type: ["image/jpg", "image/jpeg", "image/png", "image/gif"] }
validates :image, presence: true
end
Run Code Online (Sandbox Code Playgroud)
我的Pins控制器:
class PinsController < ApplicationController
before_action :set_pin, only: [:show, :edit, :update, :destroy]
before_action :correct_user, only: [:edit, :update, :destroy]
before_action :authenticate_user!, except: [:index, :show]
def index
@pins = Pin.all.order("created_at DESC").paginate(:page => params[:page], …Run Code Online (Sandbox Code Playgroud) 我使用 Django了望塔将事件记录到 AWS Cloudwatch 并在设置文件中添加了日志配置。
开发.py
boto3_session = Session(
aws_access_key_id=AWS_ACCESS_KEY_ID,
aws_secret_access_key=AWS_SECRET_ACCESS_KEY,
region_name=AWS_REGION)
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'format': "%(asctime)s [%(levelname)-8s] %(message)s",
'datefmt': "%Y-%m-%d %H:%M:%S"
},
'aws': {
# you can add specific format for aws here
'format': "%(asctime)s [%(levelname)-8s] %(message)s",
'datefmt': "%Y-%m-%d %H:%M:%S"
},
},
'handlers': {
'console': {
'class': 'logging.StreamHandler',
},
'watchtower': {
'level': 'INFO',
'class': 'watchtower.CloudWatchLogHandler',
'boto3_session': boto3_session,
'log_group': 'StagingBeagleApi',
'stream_name': 'ApplicationLogStream',
'formatter': 'aws',
},
},
'loggers': {
'django': { …Run Code Online (Sandbox Code Playgroud) 我想将Google表单中的一个答案字段设置为只读或隐藏,以便表单收件人无法修改/查看它.
那可能吗?
这是上下文:
所以基本上我的最终目标是利用Google表单功能向收件人发送调查并在响应电子表格中跟踪他们的答案.
到现在为止还挺好...
现在让我向您介绍两个强加于我的限制:
发送给收件人的表单需要有一些已预先填写的收件人信息.
提供给每个收件人以访问表单的URL用于提交并稍后更新表单上提供的答案.
看到第二个制约因素是棘手的...做的共同点是生成预填充网址发送给收件人,一旦他们已经回答的形式,你可以有一个确认页面,您为他们提供一个编辑URL,他们可以使用然后更新他们的答案(最后更新的答案已经预先填写).
就我而言,我无法为他们提供第二个网址(编辑网址).这是一次性的事情:我为每个收件人提供一个网址,他们必须能够使用相同的网址来回答和更新问题 - 如果他们需要,可以在以后再次使用.
Google不支持此功能,因此我必须编写一个从电子表格中读取的脚本,使用每行中的数据预先填写指定的表单,提交每个表单,然后为每个收件人生成一个编辑网址,然后我插入在我的电子表格的"编辑网址"列中.我现在可以将网址提供给收件人,他们将能够一遍又一遍地使用该网址来更新他们在调查中的答案.
现在回到隐藏/只读字段.在我的电子表格中,我为每个收件人提供了唯一的字母数字值.我希望将其传递给表单,以便当他们回答(答案记录在响应电子表格中)时,我将能够通过这个唯一的"id"识别每个收件人.
我在这里写了很多,但我知道为人们提供背景是很重要的,这样他们才能以精确和深思熟虑的方式互相帮助.
我正在使用Firefox加载GeoLocation的html文件。问题是我在控制台中收到以下两条消息:
TypeError: google.maps.latLng is not a constructor index.html:26
error in parsing value for 'background'. Declaration dropped.
Run Code Online (Sandbox Code Playgroud)
这是我的代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Navigator</title>
</head>
<script src="js/jquery.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=true"></script>
<script>
x = navigator.geolocation;
x.getCurrentPosition(success, failure);
function success(position) {
// fetch coordinates
var mylat = position.coords.latitude;
var mylong = position.coords.longitude;
// google api ready latitude and longitude string
var coords = new google.maps.latLng(mylat, mylong);
// setting up out google map
var mapOptions = {
zoom: 16,
center: coords,
mapTypeId: google.maps.MapTypeId.ROADMAP
} …Run Code Online (Sandbox Code Playgroud) 我想更改 Rails 应用程序中默认的“选择文件”按钮。我正在使用Bootstrap,并且想用Bootstrap Glyphicons 之一替换该按钮。

div这
是class form-group控制“选择文件”按钮的
<div class="form-group">
<%= f.label :image %><br>
<%= f.file_field :image, class: "form-control" %>
</div>
Run Code Online (Sandbox Code Playgroud) 我一直在努力解决这个问题,现在无法让它发挥作用.基本上,我有一个Google表格和一个Google电子表格.
timestamp | name | email | revenue | Edit Url
2015-2-2 02:22:22 | David | | |
2015-2-2 07:22:22 | Paul | | |
2015-2-2 09:22:22 | Olive | | |
Run Code Online (Sandbox Code Playgroud)
我想要完成的事情:
到目前为止,这是我的Google应用脚本:
function myFunction() {
createSurveyResponses();
}
function createSurveyResponses() {
// Open a form by ID and add a new text item.
var form = FormApp.openById('form_id');
var response = form.createResponse();
var sheet = SpreadsheetApp.openById('spreadsheet_id');
var getAct = sheet.getActiveSheet();
var data = sheet.getDataRange().getValues();
// …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 activerecord 导入进行导入。我收到无效参数错误我该如何解决这个问题?
谢谢
我在 postgresql 中的表架构:
create_table "vehicle_locations", force: :cascade do |t|
t.string "plate"
t.datetime "timestamp"
t.float "latitude"
t.float "longitude"
t.integer "speed"
t.integer "mileage"
t.boolean "ignition_on"
t.string "address"
end
Run Code Online (Sandbox Code Playgroud)
我正在尝试使用以下代码导入:
values = [{"plate":"xxx","timestamp":"2017-11-28
20:42:57","latitude":41.9322,"longitude":27.3253,"speed":0,"mileage":1984
04,"ignition_on":true,"address":"address"},{"plate":"xxx","timestamp":"2017-11-28 20:43:46","latitude":47.0148,"longitude":39.1805,"speed":16,"mileage":209726,"ignition_on":true,"address":"address"}]
columns = [:plate, :timestamp, :latitude, :longitude, :speed, :mileage, :ignition_on, :address ]
VehicleLocation.import columns, values
Run Code Online (Sandbox Code Playgroud)
我正在使用 postgresql、rails 5.1。
提前致谢。
2017-11-28T17:45:08.844Z 17976 TID-gn4tnwlkc WARN: ArgumentError: Invalid arguments!
2017-11-28T17:45:08.844Z 17976 TID-gn4tnwlkc WARN: /home/kayayan/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activerecord-import-0.21.0/lib/activerecord-import/import.rb:508:in `import_helper'
/home/kayayan/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/activerecord-import-0.21.0/lib/activerecord-import/import.rb:399:in `import'
/home/kayayan/Projects/RoR/trasportapp/app/workers/trio_worker.rb:23:in `perform'
/home/kayayan/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:188:in `execute_job'
/home/kayayan/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/sidekiq-5.0.5/lib/sidekiq/processor.rb:170:in `block (2 levels) in process' …Run Code Online (Sandbox Code Playgroud) 我希望div通过向上或向下滚动来将一些冗长的文本包含在可以查看文本的位置.现在,"描述"文本是这样呈现的,<%= @pin.description.html_safe %>并且在<div class="panel-body>(我正在使用Bootstrap)中.
google-forms ×2
html ×2
javascript ×2
activerecord ×1
css ×1
django ×1
geolocation ×1
google-maps ×1
heroku ×1
paperclip ×1
python ×1
ruby ×1
scrollable ×1
semantic-ui ×1
watchtower ×1