Well in the second example you have

repo.commit_all(:message)

which I suspect should be

repo.commit_all(params[:message])

On 27 May 2011 11:11, Jen <[email protected]> wrote:
> Hi,.
>
> I'm trying to parse a users commit message to the inbuilt grit grit method
> 'repo.commit_all'.
>
> The trouble is I can't figure out how to do it. The code below runs without
> throwing exceptions, but when I look in the git log my files have not been
> committed. They have however been uploaded successfully to the directory.
>
> I'm pretty new to this, so any help, advice or pointers to good grit
> tutorials would be great
>
> Code that does not commit the files:
> class UploadController < ApplicationController
> require 'grit'
> include Grit
>
> def index
> #Renders a fiew for the user.
> render 'upload.rhtml'
>  end
>  def create
> repo = Grit::Repo.new("/home/resource_portal/website/public/data/upload")
> #posts to the data model.
>    post = DataFile.save(params[:upload])
> puts "file uploaded"
> render 'upload'
> post = repo.commit_all(params[:message])
>  end
> end
>
>
> Code that commits the files but does not add the users commit message:
> class UploadController < ApplicationController
> require 'grit'
> include Grit
>
> def index
> #Renders a fiew for the user.
> render 'upload.rhtml'
>  end
>  def create
> repo = Grit::Repo.new("/home/resource_portal/website/public/data/upload")
> #posts to the data model.
>    post = DataFile.save(params[:upload])
> puts "file uploaded"
> render 'upload'
> repo.commit_all(:message)
>  end
> end
>
> --
> 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.
>
>

-- 
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.

Reply via email to