I am trying to commit files uploaded by my user to GIT using 'grit' but can't figure out how to achieve this.
My file is stored in an 'upload' object. I tried 'upload.commit' but this doesn't work. I'm guessing it's because the 'upload' object is a hash, which means I was trying to commit the hash.
The model I'm using for this is attached. Any help would be great. Also if anyone can recommend any GRIT documentation/tutorials that would be useful, as I can't find very much info out there.
Thanks for the suggestions. I've restructured my application a bit, but am running in to problems with 'repo' not being defined in the controller. I'm actually a bit confused about where the method to commit the files should go. My thinking is that it should be in the model (as that handles validation and persistence) and the controller call it If this is not the correct way to do things I'd be glad to here any suggestions.
Also I'm currently creating the 'repo' object, then giving it to the method as an argument. Can I create it inside the method then just call the '.commit_all' method on it?
Do I even need my own method? Can I just create the repo object in the model then call repo.commit_all on it?
Finally got stuff committing to GIT, but not sure what the heck is going on with the 'message' variable, so need to do some reading to refresh my memory of that. I've attached my code in case anyone is interested
It's probably the biggest cludge in the world, so any suggestions on how I could improve it would be great!