Hi,
I'm a bit closer to achieving what I want, but still could use a few pointers.

I believe I need to use 'repo.commit_all' after the file has been uploaded. I've added a method to my model and am calling it from the upload controller. I keep getting the following error:


 ArgumentError in UploadController#create

wrong number of arguments (0 for 1)

|Rails.root: /home/resource_portal/website|

Application Trace <http://localhost:3000/upload#> | Framework Trace <http://localhost:3000/upload#> | Full Trace <http://localhost:3000/upload#>

|app/models/data_file.rb:18:in `commit'
app/controllers/upload_controller.rb:9:in `create'
rake-0.8.7/ruby/1.9.1/gems/actionpack-3.0.3/lib/action_controller/metal/implicit_render.rb:4:in
 `send_action'
rake-0.8.7/ruby/1.9.1/gems/actionpack-3.0.3/lib/abstract_controller/base.rb:151:in
 `process_action'
|


...

The model and controller are attached.

Thanks in advance for any help,
Jen.


On 18/05/11 08:21, Jen wrote:
Hi,
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,
Jen.


--
You received this message because you are subscribed to the Google Groups "Ruby on 
Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Attachment: data_file.rb
Description: application/ruby

Attachment: upload_controller.rb
Description: application/ruby

Reply via email to