我的代码:
def edit
@post = Post.find_by(slug: params[:id])
options: {
bucket: 'uploads',
region: 'us-west-2',
keyStart: 'uploads',
acl: 'public-read',
accessKey: Rails.application.secrets.access_key_id,
secretKey: Rails.application.secrets.secret_access_key
}
@aws_data = FroalaEditorSDK::S3.data_hash(options)
end
错误:
syntax error, unexpected ':', expecting keyword_end options: { ^
答案 0 :(得分:3)
该文章中显然存在语法错误。变化
options: {
到
options = {
将哈希值分配给options
变量。