Skip to content

Instantly share code, notes, and snippets.

@ndee
Created January 15, 2015 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndee/6d42c3cce01bcd131a9f to your computer and use it in GitHub Desktop.
Save ndee/6d42c3cce01bcd131a9f to your computer and use it in GitHub Desktop.
cfs:autoform: File input doesn't show up
var FileStore = new FS.Store.S3("filesStore", {
// Credentials
});
Files = new FS.Collection("files", {
stores: [FileStore]
});
Files.allow({
download: function () {
return true;
},
fetch: null
});
if(Meteor.isServer) {
Meteor.publish('files', function() {
return Files.find({});
});
}
// TODO: This could be a performance bottleneck
if(Meteor.isClient) {
Meteor.subscribe('files');
}
ItemSchema = new SimpleSchema({
name: {
type: String,
label: "Name"
},
comment: {
type: String,
label: "Comment",
optional: true
},
fileId: {
type: String,
label: 'File',
optional: true,
autoform: {
afFieldInput: {
type: "cfs-file",
collection: "files"
}
}
}
});
<template name="exampleTypeForm">
{{#autoForm id="itemForm" collection=Items type="insert"}}
{{> afQuickField name="name" }}
{{> afQuickField name="comment" }}
{{> afQuickField name="fileId"}}
<div>
<button type="submit" class="btn btn-primary">Submit</button>
</div>
{{/autoForm}}
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment