def upload
  @title ="Przelij swj awatar"
  @user = User.find(session[:user_id])
  if param_posted?(:avatar)
    image = params[:avatar][:image]
    @avatar = Avatar.new(@user, image)
    if @avatar.save
      flash[:notice] = "Twj awatar zosta zapisany."
      redirect_to hub_url
    end
  end
end

