ruby on rails - Render Paperclip Avatar -


i'm trying render user's avatar on show page.

scenario: user creates account , set's avatar. avatar displayed correctly oh profile page(stretchy there). on page says

undefined method `avatar' nil:nilclass 

the code

<%= image_tag @user.avatar.url(:avatar), class: "size48" %>  

edit

in views folder image get's rendered on users folder, on other folders im getting error.

usermodel -> http://pastebin.com/pdttlgrw

@user variable nil. there should @user = user.find(params[:id]) in controller action of page you're trying load.


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -