Image uploadin error

hi all!
I m trying to upload image using paperclip in rails3…

In users controller of my application
(M TRYIN TO DISPLAY THE IMAGE IN THE SAME PAGE OF UPLOAD FILE(BUTTON)
PAGE
)
i ve defined 2 methods
def photo
end

def update_photo
end

  • In photo.html.erb *
    <%= image_tag @user.avatar.url(:medium) %>
    <%= button_to “Delete”, user, :method => :delete, :confirm => ‘Are you
    sure
    to delete the image’ %>
    <% form_for :user, @user, :url => update_photo_user_path(current_user),
    :html => { :multipart => true } do |form| %>

    WEN I RUN DIS CODE IN THE BROWSER I GET

    undefined method `avatar’ for nil:NilClass ERROR

    choose: <%= form.file_field :avatar %>
    <%= submit_tag("Uploadfile") %>

Hi,
In user model, do u have any field named avatar? and also y ur
passing
user as symbol and instance variable in form_for tag? remove the
symbol.

Thanks,
Manivannan.s

On Fri, Aug 12, 2011 at 2:45 PM, Annapoorna R [email protected]
wrote:

end*
choose:

For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.


Regards,
Manivannan.S