the line

redirect_to :action => index

should be

redirect_to :action => :index

or is it just a typo? i don't know why it's not throwing an error
complaining that there's no index variable so maybe it's just a typo.

On Sat, Feb 19, 2011 at 2:22 AM, rixter <[email protected]> wrote:

> ROR newbie here...
>
> I'm trying to build a form to upload a CSV file, then parse and store the
> data. I have debugged this code up this point, but now when I browse to my
> csv file, and click Upload, I get this error:
>
> "Missing template uploads/process_file.html.erb in view path..."
>
>
>
>
> Here is my view (in /uploads/new.html.erb)
>
> <% form_tag ({:action => 'process_file'},
>               :multipart => true) do %>
>   <%= file_field_tag 'file' %>
>   <p>
>     <%= submit_tag "Upload" %>
>   </p>
>
> <% end %>
>
> Here is my controller, (in /controllers/uploads_controller.rb)
>
>   def process_file
>     post = Upload.import(params[:file])
>     flash[:ok] = "data imported"
>     redirect_to :action => index
>   end
>
>
> and here is my model (in models/upload.rb):
>
>  def self.import(file)
>
>  FasterCSV.foreach(file.path,:headers=>"first_row", :col_sep=>"\t") do
> |row|
>        # here is where we will parse the data but just this stub for now:
>        row.each{|row| puts "row: #{row.inspect}"}
>      end
>   end
>
>
> Can anyone please point out my dumb error here?
> Would sooooooooo appreciate the help (this forum rocks....have learned a
> bunch here.....)
> --Rick
>
> --
> 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.
>



-- 
-------------------------------------------------------------
visit my blog at http://jimlabs.heroku.com

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