# Routing Error using Paperclip

**URL:** <https://www.ruby-forum.com/t/routing-error-using-paperclip/184200>\
**Category:** Rails\
**Created:** [February 26, 2010, 4:52pm UTC](https://www.ruby-forum.com/t/routing-error-using-paperclip/184200 "2010-02-26T16:52:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [February 26, 2010, 4:52pm UTC](https://www.ruby-forum.com/t/routing-error-using-paperclip/184200/1 "2010-02-26T16:52:49Z")

</div>

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:  
“removed\_email\_address@domain.invalid”, 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: “removed\_email\_address@domain.invalid”, 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 %\>  
  
\<%= f.text\_field :name %\>  
  
\<%= f.label :surname %\>  
  
\<%= f.text\_field :surname %\>  
  
\<%= f.label :email %\>  
  
\<%= f.text\_field :email %\>  
  
\<%= f.label :password %\>  
  
\<%= f.password\_field :password %\>

\<%= f.label 'Picture' %\> \<%= f.file\_field :photo%\>

 \<%= 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’

–  
Kind Regards,  
Rajinder Y.

---

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [February 26, 2010, 4:59pm UTC](https://www.ruby-forum.com/t/routing-error-using-paperclip/184200/2 "2010-02-26T16:59:16Z")

</div>

Rajinder Y. wrote:

> :id=\>#\<User id: nil, name: “Rajinder”, surname: “Yadav”, email:
> 
> \<%= f.label :password %\>
> 
> map.resources :users  
> map.connect ‘:controller/:action/:id’  
> map.connect ‘:controller/:action/:id.:format’

I narrowed the error down, it seems that the call to create is failing?

@user = User.create params[:user]  
redirect\_to user\_path @user

so the redirect is producing the error. I have no idea why create is  
failing, it was working before I added the Paperclip support.

---

<div class="post-metadata">

**Author:** ![Rajinder\_Y](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/91b2a8/32.png) [@Rajinder\_Y](https://www.ruby-forum.com/u/Rajinder_Y)\
**Post date:** [February 26, 2010, 5:33pm UTC](https://www.ruby-forum.com/t/routing-error-using-paperclip/184200/3 "2010-02-26T17:33:48Z")

</div>

Rajinder Y. wrote:

> > user\_url failed to generate from {:action=\>“show”,  
> > photo\_content\_type: “image/jpeg”, photo\_file\_size: 34846\>}  
> > \<%= f.text\_field :email %\>  
> >   
> > and the entries in routes.rb are
> 
> so the redirect is producing the error. I have no idea why create is  
> failing, it was working before I added the Paperclip support.

I found the reason why I was getting an error, it was a thumbnail  
processing error. I recall installing RMagick lastnight and I think I  
read somewhere it download installs its own version of ImageMagick? The  
Fix was for me to reinstall ImageMagick and now the code is working.

Does RMagick really break functionality fir Paperclip if it’s installed  
after? If this is the case I think this should be fixed. I spent a few  
hours last night trying to figure out the error. All was not, being new  
to Rails I learned how to track down the error, but still burning hours  
on something like this is not the best use of anyone’s time!!!

Kind Regards,  
Rajinder Y.
