[Rails] what's the correct syntax to process a file_field object?

2011-02-25 Thread rixter
I am using Rails 2.1 (and RUBYGEMS VERSION: 1.5.0 RUBY VERSION: 1.8.7) and have been having a *devil* of a time trying to get a simple thing to work: upload and process a CSV file. After extensively researching many examples both here and elsewhere, I have not been successful in getting this wor

[Rails] why accessor method not firing?

2011-02-22 Thread rixter
@upload.save is firing without the accessor method having obtained the filename for it to be populated when the upload object gets saved. But why would the book example work, and not in my case? I would extremely grateful if anyone can point out to me the error my ways! thanks, rixter

[Rails] Using form_tag with a bit of rails 'magic'?

2011-02-18 Thread rixter
I'm trying to follow an example from 'Agile Web Development with Rails' (3rd ed) which shows how to upload an image file, except that I'm trying to upload a csv file. The 'magic' that the example shows is how the file_field helper method can say "file_field("uploaded_file")" when there is actua

[Rails] why 'Template missing' error with form_tag?

2011-02-18 Thread rixter
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 v

Re: [Rails] need help w/ MVC coding of simple use of FasterCSV

2011-02-17 Thread rixter
Thanks! That helped..(.now on to the next bug...) 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 rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-tal

[Rails] need help w/ MVC coding of simple use of FasterCSV

2011-02-17 Thread rixter
I'm new to ROR, so still getting used to the MVC syntax; but think I have a simple example here that I hope someone can tell me what I'm doing wrong (& maybe help someone else by doing so): All I'm trying to do is upload a CSV file, then parse each row of data in it (the first how contains head

[Rails] Re: ROR newb with MVC question

2011-02-01 Thread rixter
Awesome...thanks Tsega...will chew on this awhilea big help! --rixter -- 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,

Re: [Rails] ROR newb with MVC question

2011-02-01 Thread rixter
ot;upload"} Rendering upload/index I'm still puzzled: why is the uploadFile method not getting called, when the submit action clearly states: <% form_tag ({*:action => 'uploadFile*'}, :multipart => true) do %> thx for the help, still wondering, rixter -- Y

Re: [Rails] ROR newb with MVC question

2011-02-01 Thread rixter
{:action => 'uploadFile'}, :multipart => true) do %> Select File : <%= file_field 'upload', 'datafile' %> <%= submit_tag "Upload" %> <% end %> Still a mystery to me... --rixter -- You received this message because you are su

Re: [Rails] ROR newb with MVC question

2011-02-01 Thread rixter
rectly, and then to the model correctly, where the data gets imported into the database. But I obviously still have major errors in how this is coded Any other suggestions appreciated... Thanks again, rixter -- You received this message because you are subscribed to the Google Groups "Ruby

[Rails] ROR newb with MVC question

2011-02-01 Thread rixter
I'm new to ROR and still trying to wrap my mind around the MVC construct. Hope someone can spot what is probably a simple error here. I need to have a user upload a CSV file, parse the header (the table field names) then each row of data, and import the data into its respective tables. In the

[Rails] unexpected kRESCUE, expecting kEND

2011-01-25 Thread rixter
Rather a newbie to Ruby code, so hopefully this error should be easy to spot...can anyone please tell me why I'm getting 'syntax error, unexpected kRESCUE, expecting kEND' with the line that says 'rescue Exception' in the code section below? Much appreciate any help... Thx, mr noob begin r