0
votes

I'm trying to learn how to upload a data file to an application by following the instructions http://bit.ly/JgJyV and http://bit.ly/LXZ44L.

After following the instructions and typing in the code I open my browser and go to the link below.

localhost URL on port 3000: .../upload/index

Routing Error No route matches [GET] "/upload/index" Try running rake routes for more information on available routes.

I update config/routes.rb with:

resources: upload

Revisit localhost URL on port 3000: .../upload/index

Unknown action The action 'show' could not be found for UploadController

Try localhost URL on port 3000: .../upload Works! I select a file and click the Upload button:

Routing Error No route matches [POST] "/assets"

rake routes returns: Steves-iMac:config steve$ rake routes upload_index GET /upload(.:format) upload#index

         POST   /upload(.:format)          upload#create

new_upload GET /upload/new(.:format) upload#new

edit_upload GET /upload/:id/edit(.:format) upload#edit

  upload GET    /upload/:id(.:format)      upload#show

         PUT    /upload/:id(.:format)      upload#update

         DELETE /upload/:id(.:format)      upload#destroy

Any ideas?

1
Can you post the model, view and controller code.? and cool that you dont use a Gem and develop things from scratch. Its when you get a great handle of things and customize them however you want.beck03076

1 Answers

-1
votes

There are widely used ruby gems to do what you want to do: Paperclip and Carrierwave.
So, why reinvent the wheel?