For some reason I can't figure out why I am getting a routing error when I add Paperclip support. I have another test app when similar code is working.
I created a new test app first without Paperclip support and it was doing the CRUD operation fine. However when I added Paperclip support I get the following error?
Routing Error user_url failed to generate from {:action=>"show", :controller=>"users", :id=>#<User id: nil, name: "Rajinder", surname: "Yadav", email: "test@email.com", password: "hello", membership_level: 0, location: nil, timezone: nil, bday: nil, last_visit: nil, visits: nil, created_at: nil, updated_at: nil, photo_file_name: "devmentor.jpg", photo_content_type: "image/jpeg", photo_file_size: 34846>}, expected: {:action=>"show", :controller=>"users"}, diff: {:id=>#<User id: nil, name: "Rajinder", surname: "Yadav", email: "test@email.com", password: "password", membership_level: 0, location: nil, timezone: nil, bday: nil, last_visit: nil, visits: nil, created_at: nil, updated_at: nil, photo_file_name: "devmentor.jpg", photo_content_type: "image/jpeg", photo_file_size: 34846>}
The form I am using to submit looks like this
<% form_for @user, :html => { :multipart => true } do |f| %> <%= f.label :name %><br/> <%= f.text_field :name %><br/> <%= f.label :surname %><br/> <%= f.text_field :surname %><br/> <%= f.label :email %><br/> <%= f.text_field :email %><br/> <%= f.label :password %><br/> <%= f.password_field :password %><br/> <p> <%= f.label 'Picture' %> <%= f.file_field :photo%> </p> <%= submit_tag 'Create Account' %> <% end %>
and the entries in routes.rb are
map.resources :users map.connect ':controller/:action/:id' map.connect ':controller/:action/:id.:format'