Re: [Rails] ROR newb with MVC question

2011-02-01 Thread rixter
Ok, I did the following: - moved the code to app/views/upload/index.html.erb - uncommented the index method in the controller, but made it empty Now, I no longer get any error message, but when I submit a file and click the Upload button, the form just flashes, but comes back with an empty field

Re: [Rails] ROR newb with MVC question

2011-02-01 Thread Garrett Lancaster
It appears the uploadFile method is getting called because its redirecting to :index, which doesn't exist now since you deleted it. There are many issues here, but try the following: 1) put the code in uploadfile.html.erb in app/views/upload/index.html.erb 2) uncomment the index action, but make

Re: [Rails] ROR newb with MVC question

2011-02-01 Thread rixter
So, I commented out the index method in my controller, just leaving the view as before. Now I get the error: Unknown action No action responded to index so my question now is, why doesn't the method uploadFile get called in the controller from the view with this code: <% form_tag ({:action

Re: [Rails] ROR newb with MVC question

2011-02-01 Thread rixter
Thanks for catching my dumb error with the backslashes...(this is running on Linux after all...). As you can tell, I'm crudely cutting-&-pasting code from online examples... Yes, there is a file app/views/upload/uploadfile.html.erb, which is the view for my Upload class. I'm not sure why I'm r

Re: [Rails] ROR newb with MVC question

2011-02-01 Thread Garrett Lancaster
The most obvious answer is: do you have a file app\views\upload\uploadfile.html.erb? (also, why the backslashes?) Not quite sure why you're rendering a file like that...the idiomatic way is to have a file in app/views/uploads/index.html.erb that displays whatever you want (in this case presuma

[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