Import File problem

M

M Beale

I have a problem I am hoping someone can help me out with. I am trying
to import a csv file and it goes smoothly while trying to work in my
development environment(radrails) but when deploying it with instant
rails I get the following message:

Errno::ENOENT in Sales headerController#import

No such file or directory - Default.pmx.csv

Here is the html code

<form action="/sales_header/import/1?multipart=true" method="post">
<input type="file" name="importfile" />
<input name="commit" type="submit" value="Import" />
</form>

here is the rails code

def import
CSV.open(params['importfile'], 'r') do |row|
if(@recipe = RecipeHeader.find:)first,:conditions=>['plu = ?
',row[2]]))
if(@detail =
SalesDetail.find:)first,:conditions=>['recipe_header_id = ? and
sales_header_id = ?',@recipe.id,params[:id]]))
@detail.quantity = row[4]
@detail.save
end
end
end
end
redirect_to :action => 'edit', :id=>params[:id]
end

I am totally stumped so any help would be appreciated!!!

TIA

Mike Beale
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,260
Messages
2,571,308
Members
47,956
Latest member
AmeeBerger

Latest Threads

Top