Re: File Upload: No Method Error

From the examples of rewriting accessor and write functions i've seen, that's a totally valid thing to do. I believe when Project_file.new is called and given params[:project_file] it passes the hash contained by params[:project_file] in via the argument set in the write file_name= function. However, I could be way off base. But sadly, and obviously, no one has let me know that I'm writing this all wrong yet. Thanks for the post, maybe I'll get some more input now.

If art interprets our dreams, the computer executes them in the guise of programs.

Re: File Upload: No Method Error

From the looks of the error message, the argument passed to file_name=() or content_type=() is a File object. Sounds like a perfect job for a breakpoint. If you haven't used breakpoints before, I would highly recommend trying it out. They make debugging so much easier.

Just add a line "breakpoint" to the beginning of the file_name=() and content_type=() method definitions. Call "script/breakpointer" in the command line (ignore the error message about no breakpoint service found). Now load the page in the web browser that calls the code with the breakpoint in it. When the breakpoint line is called, the script/breakpointer prompt turns into an interactive ruby session right where the breakpoint line was. You have access to all of the local variables and such. You can call "project_file.class" to see what type of object the project_file is. See the docs for some more details. Also see the wiki page.