Ruby on Rails Tuesday, February 1, 2011

One thing I forgot here is that you need to add the create action in your controller that would be used to house the code for uploading the file:

def create
  post = Import.proc_csv( params[:upload])
  flash[:notice] = "File imported successfully"
  redirect_to :action => :index   
  rescue      
      flash[:error] = "Error importing file"
      redirect_to :action => 'index'
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment